Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restapi: Add configurable response headers #578

Merged
merged 2 commits into from Oct 18, 2018
Merged

Conversation

hsanjuan
Copy link
Collaborator

By default, CORS headers allowing GET requests from everywhere are
set. This should facilitate the IPFS Web UI integration with the
Cluster API.

This commit refactors the sendResponse methods in the API, merging
them into one as it was difficult to follow the flows that actually
send something to the client. All tests now check the presence of
the configured headers too, to make sure no route was missed.

License: MIT
Signed-off-by: Hector Sanjuan code@hector.link

@hsanjuan hsanjuan self-assigned this Oct 16, 2018
@ghost ghost added the status/in-progress In progress label Oct 16, 2018
@hsanjuan
Copy link
Collaborator Author

ipfs gui issue: ipfs/ipfs-gui#59 (comment)

api/rest/restapi.go Outdated Show resolved Hide resolved
api/rest/restapi.go Outdated Show resolved Hide resolved
By default, CORS headers allowing GET requests from everywhere are
set. This should facilitate the IPFS Web UI integration with the
Cluster API.

This commit refactors the sendResponse methods in the API, merging
them into one as it was difficult to follow the flows that actually
send something to the client. All tests now check the presence of
the configured headers too, to make sure no route was missed.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
@hsanjuan
Copy link
Collaborator Author

gitcop doesn't like the new suggestion feature much..

@coveralls
Copy link

coveralls commented Oct 17, 2018

Coverage Status

Coverage increased (+0.2%) to 65.479% when pulling 562ad71 on feat/api-headers into d29e993 on master.

api/rest/restapi.go Outdated Show resolved Hide resolved
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
@hsanjuan hsanjuan merged commit f669d75 into master Oct 18, 2018
@hsanjuan hsanjuan deleted the feat/api-headers branch October 18, 2018 09:19
@ghost ghost removed the status/in-progress In progress label Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants