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

Auto-referer header fixes #393

Merged
merged 5 commits into from
May 6, 2022
Merged

Auto-referer header fixes #393

merged 5 commits into from
May 6, 2022

Conversation

sagebind
Copy link
Owner

@sagebind sagebind commented May 5, 2022

Fix various aspects of the auto_referer option:

  • Fix multiple Referer headers being included when two or more redirects are followed in a request
  • URL fragments and userinfo parts of the authority should not be included in the Referer header
  • Don't include a Referer header when redirecting from an HTTPS URL to an HTTP URL, as per RFC 7231 recommendation
  • Scrub sensitive headers when redirecting to a different authority

Fixes #392

URL fragments and userinfo parts of the authority should not be included in the Referer header when `auto_referer` is enabled.

Fixes #392
@codecov
Copy link

codecov bot commented May 5, 2022

Codecov Report

Merging #393 (789ef4a) into master (991e777) will increase coverage by 0.41%.
The diff coverage is 94.91%.

@@            Coverage Diff             @@
##           master     #393      +/-   ##
==========================================
+ Coverage   79.41%   79.83%   +0.41%     
==========================================
  Files          52       52              
  Lines        3119     3169      +50     
==========================================
+ Hits         2477     2530      +53     
+ Misses        642      639       -3     
Impacted Files Coverage Δ
src/redirect.rs 78.35% <94.54%> (+10.12%) ⬆️
tests/redirects.rs 100.00% <100.00%> (ø)
src/response.rs 70.37% <0.00%> (+1.85%) ⬆️
src/cookies/interceptor.rs 73.91% <0.00%> (+4.34%) ⬆️
src/headers.rs 78.57% <0.00%> (+14.28%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 991e777...789ef4a. Read the comment docs.

@sagebind sagebind changed the title Fix incorrectly-formatted Referer headers Auto-referer header fixes May 6, 2022
@sagebind sagebind merged commit b8cddd2 into master May 6, 2022
@sagebind sagebind deleted the 392-referer-string-parts branch May 6, 2022 02:05
sagebind added a commit that referenced this pull request May 13, 2022
Fix various aspects of the `auto_referer` option:

- Fix multiple `Referer` headers being included when two or more redirects are followed in a request
- URL fragments and userinfo parts of the authority should not be included in the `Referer` header
- Don't include a `Referer` header when redirecting from an HTTPS URL to an HTTP URL, as per [RFC 7231](https://httpwg.org/specs/rfc7231.html#header.referer) recommendation
- Scrub sensitive headers when redirecting to a different authority

Fixes #392
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

Successfully merging this pull request may close these issues.

Bug in auto_referer implementation
1 participant