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

HTTP_ORIGIN wild card #9

Open
caseman72 opened this issue Aug 21, 2014 · 3 comments
Open

HTTP_ORIGIN wild card #9

caseman72 opened this issue Aug 21, 2014 · 3 comments

Comments

@caseman72
Copy link

For
Access-Control-Allow-Origin

It would be nice to pass the current URL so if the value in the settings was:
HTTP_ORIGIN

Then you would replace that with the current url in the header ...

In my nginx.conf file I do this:
more_set_headers 'Access-Control-Allow-Origin: $http_origin';
more_set_headers 'Access-Control-Allow-Credentials: true';

@chrisdeely
Copy link
Owner

that's a great idea! Interested in working on it?

On Thu, Aug 21, 2014 at 3:26 PM, caseman72 [email protected] wrote:

For
Access-Control-Allow-Origin

It would be nice to pass the current URL so if the value in the settings
was:
HTTP_ORIGIN

Then you would replace that with the current url in the header ...

In my nginx.conf file I do this:
more_set_headers 'Access-Control-Allow-Origin: $http_origin';
more_set_headers 'Access-Control-Allow-Credentials: true';


Reply to this email directly or view it on GitHub
#9.

@caseman72
Copy link
Author

Looking at the code now ... wonder if it would work with my plugin (https://github.com/caseman72/garmin.com.js) as I have to proxy the code through an nginx server to get it to work ... but if I can make Chrome think they have CORS headers then I get get around that

To get it to work - it should be straight forward if/then - just need to get the current URL ... I will fork and test ...

@chrisdeely
Copy link
Owner

Easiest route is probably to look at the header value in https://github.com/chrisdeely/ForceCORS/blob/master/background.js#L47-L51

If it matches "HTTP_ORIGIN" replace with the current Host value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants