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

setting Access-Control-Allow-Origin header on http api #697

Closed
MansM opened this issue Jan 22, 2016 · 3 comments
Closed

setting Access-Control-Allow-Origin header on http api #697

MansM opened this issue Jan 22, 2016 · 3 comments
Labels
theme/api HTTP API and SDK issues

Comments

@MansM
Copy link
Contributor

MansM commented Jan 22, 2016

I was creating a small ui for nomad to allow me to see the status of jobs in a webbased format.
When using jQuery I stumbled on the fact that nomad doesnt set the Access-Control-Allow-Origin header. This results in browser messages like: XMLHttpRequest cannot load http://10.0.50.11:4646/v1/jobs?pretty&_=1453414011020. Response for preflight has invalid HTTP status code 405
index.html:70 ajax error 0

I would probably be able to fix this with using a reverse proxy, but I would like to configure a setting to enable setting the header Access-Control-Allow-Origin: *

@KenVanHoeylandt
Copy link

I suggest to also add support for Access-Control-Request-Method and Access-Control-Request-Headers too.
A temporary hack could be just relaying the requested values in the Access-Control-Allow-Methods and Access-Control-Allow-Headers response.

@diptanu
Copy link
Contributor

diptanu commented Jan 22, 2016

@MansM @KenVanHoeylandt You should be able to configure the API servers to set arbitrary headers via the agent configuration with this PR. Hoping that would work for you?

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
theme/api HTTP API and SDK issues
Projects
None yet
Development

No branches or pull requests

3 participants