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 ReferrerPolicy to Secure middleware #1363

Merged
merged 1 commit into from
Aug 1, 2019
Merged

Add ReferrerPolicy to Secure middleware #1363

merged 1 commit into from
Aug 1, 2019

Conversation

htdvisser
Copy link
Contributor

This Pull Request adds Referrer-Policy to the Secure middleware.

The goal of this header is to hide potentially sensitive referrer information (such as the origin or path of the original request).

Example:

If a user visits the hypothetical https://echo.labstack.com/?some_secure_token=foobarbaz, a request is made to https://use.fontawesome.com/releases/v5.0.8/js/all.js. This request contains a header Referer: https://echo.labstack.com/?some_secure_token=foobarbaz. FontAwesome does not need to know some_secure_token to give us icons, so we should limit the information they get from us in the Referer header. This can be done by setting a Referrer-Policy header.

@codecov
Copy link

codecov bot commented Jul 8, 2019

Codecov Report

Merging #1363 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1363      +/-   ##
==========================================
+ Coverage   84.15%   84.17%   +0.01%     
==========================================
  Files          27       27              
  Lines        2058     2060       +2     
==========================================
+ Hits         1732     1734       +2     
  Misses        212      212              
  Partials      114      114
Impacted Files Coverage Δ
echo.go 85.62% <ø> (ø) ⬆️
middleware/secure.go 93.75% <100%> (+0.41%) ⬆️

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 01229ec...028132d. Read the comment docs.

@vishr vishr merged commit 87da9a9 into labstack:master Aug 1, 2019
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.

2 participants