Fix HIDE_REFERER env option for hiding changedetection.io from referer headers (#2787)

This commit is contained in:
Tyler Schrock
2024-12-03 06:54:58 -05:00
committed by GitHub
parent 7421e0f95e
commit 84f2870d4f

View File

@@ -160,11 +160,10 @@ def main():
)
# Monitored websites will not receive a Referer header when a user clicks on an outgoing link.
# @Note: Incompatible with password login (and maybe other features) for now, submit a PR!
@app.after_request
def hide_referrer(response):
if strtobool(os.getenv("HIDE_REFERER", 'false')):
response.headers["Referrer-Policy"] = "no-referrer"
response.headers["Referrer-Policy"] = "same-origin"
return response