Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

required changes for the gateway #1003

Merged
merged 1 commit into from
Sep 8, 2017

Conversation

ya7ya
Copy link
Contributor

@ya7ya ya7ya commented Sep 7, 2017

These are the required changes requested by @dignifiedquire in #968

UDPATE: I just noticed @victorbjelkholm requested changes, I'll implement them and push them to this branch as well.

Changes:

  • use slice instead of splice

  • remove noop since promisify always defines a callback

  • use async reduce instead of eachOfSeries

  • no duplicate logging + returning error

  • smallCamelCase for non-constructors

  • fix indentations

  • use callbacks instead of promises.

  • use pull.through instead of pull.drain so response isn't completely held in memory before responding

  • use switch since there are too many conditions to check

  • use templating engine. (still in discussion, no clear decision yet. Let me know when you guys decide)

  • internal cat with pull streams for efficiency. (outside the scope of this feature. but a very cool idea that I think we should have)

Please Let me know if there are any other changes required. Thanks for your help 👍

@daviddias
Copy link
Member

use templating engine. (still in discussion, no clear decision yet. Let me know when you guys decide)

I'm fine with doing as it is for now and adding that to a separate issue.

internal cat with pull streams for efficiency. (outside the scope of this feature. but a very cool idea that I think we should have)

This will be the focus of js-ipfs 0.27 -> ipfs-inactive/interface-js-ipfs-core#126

.header('Access-Control-Allow-Methods', 'GET')
.header('Access-Control-Allow-Origin', '*')
.header('Access-Control-Expose-Headers', 'X-Stream-Output, X-Chunked-Ouput')
.send()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of these addrs are not required. I'll fix it in the main PR.

@daviddias daviddias merged commit 3e6b012 into ipfs:feat/gateway Sep 8, 2017
MicrowaveDev pushed a commit to galtproject/js-ipfs that referenced this pull request May 22, 2020
Correcting the array check to happen before the individual element checks. fixes ipfs-inactive/js-ipfs-http-client#928
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants