-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add CORS support #10546
Add CORS support #10546
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of questions.
@rhatdan I am now figuring out a way to test this. It seems like I will have to come up with a solution from scratch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question and one change request.
pkg/api/server/handler_api.go
Outdated
@@ -63,6 +63,12 @@ func (s *APIServer) APIHandler(h http.HandlerFunc) http.HandlerFunc { | |||
w.Header().Set("Libpod-API-Version", lv) | |||
w.Header().Set("Server", "Libpod/"+lv+" ("+runtime.GOOS+")") | |||
|
|||
if s.CorsHeaders != "" { | |||
w.Header().Set("Access-Control-Allow-Origin", s.CorsHeaders) | |||
w.Header().Set("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, X-Registry-Auth") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need "Connection" and "Upgrade" in this header list?
We do need "X-Registry-Config".
Changes LGTM once tests and @jwhonce 's concerns are addressed |
gack, hit the wrong button, didn't mean to close. |
[NO TESTS NEEDED] Signed-off-by: Boaz Shuster <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: boaz0, jwhonce, rhatdan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
No description provided.