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

Filter the headers when redirecting #10

Closed
seanmonstar opened this issue Nov 8, 2016 · 5 comments
Closed

Filter the headers when redirecting #10

seanmonstar opened this issue Nov 8, 2016 · 5 comments

Comments

@seanmonstar
Copy link
Owner

Some headers should be removed when redirecting to a different domain:

  • Cookie
  • Authorization
@steverob
Copy link
Contributor

@seanmonstar can I work on this? Rust beginner here :)

@seanmonstar
Copy link
Owner Author

Definitely! All issues can always be worked on.

@steverob
Copy link
Contributor

@seanmonstar yay. I'll jump in right away.

@steverob
Copy link
Contributor

@seanmonstar I went through the code and I guess I'll need to call some headers.remove in this part of the client.rs - https://github.com/seanmonstar/reqwest/blob/master/src/client.rs#L308 after checking if we're being sent to a different domain. Is that okay?

Also, I'm wondering how we can write tests for this as the $HOST is always 127.0.0.1:PORT. Any pointers on how I can proceed here? Thanks :)

@seanmonstar
Copy link
Owner Author

Yes, definitely, headers.remove is the correct thing to do.

For the tests, I suppose we would just want to unit tests in client.rs. With the addition of proxies (from #30), we could easily setup some proxies that still connect to the localhost server while seeming like different domains...

steverob added a commit to steverob/reqwest that referenced this issue May 15, 2017
… host than of the Referrer

Removes Cookie, Authorization and WWW-Authenticate cookies.

Resolves seanmonstar#10
repi pushed a commit to EmbarkStudios/reqwest that referenced this issue Dec 20, 2019
repi pushed a commit to EmbarkStudios/reqwest that referenced this issue Dec 20, 2019
Use hyper-native-tls for https
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

No branches or pull requests

2 participants