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

Add an option to ignore or not the http header "Origin" #165

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thinwind
Copy link

@thinwind thinwind commented Sep 24, 2019

Add a parameter to decide whether or not to keep the header "Origin". If the target server does not support CORS(As I have actually met) and the request has an "Origin", a failure will happen.
When ignore the "Origin", everything will be just fine.

Add an parameter to decide whether or not to keep the header "Origin". If the target server does not support CORS and the request has an "Origin", a failure will happen.
When ignore the "Origin" item, everything will be just fine.
@dsmiley
Copy link
Collaborator

dsmiley commented Sep 27, 2020

I wonder if this would break a pre-flight CORS request? I dunno; if I had more evidence this approach is used elsewhere then I might be inclined to include it. I'd be inclined to include a generalized header stripper thing that basically added to hopByHopHeaders (well, not the static one but a new one for the instance of the servlet). Such a generalized mechanism would take a comma delimited list of headers.

@thinwind
Copy link
Author

thinwind commented Sep 29, 2020

In my case, the servlet just works for my own frontend. The site shows many apis by swagger docs. And the requests to the apis will be passed through the servlet. So there may be no needs for pre-flight CORS requests. Anyway, this will do no harm if you just leave the option as it not exists.
By the way, I think the generalized header stripper thing is a really wonderful idea.

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

Successfully merging this pull request may close these issues.

2 participants