fix: 将 referrer policy 修改为 same-origin #814
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
我尝试把
nas-tools
反向代理到https://domain.com/nas-tools/
下,但nas-tools
本身不支持反代到某个路径下,所以尝试判断 Referer 请求头进行 workaround(若 Referer 以https://domain.com/nas-tools
为开头则反代到localhost:3000
),但是 nas-tools 把Referrer-Policy
设置为了never
。修改为same-origin
后,只会向网站源域名/端口发送 Referer 请求头,跨站请求时不会发送,保证域名不会泄露。判断 Referer workaround
以 Caddy 为例