Option to Hide the Referer header from monitored websites. (#996)

This commit is contained in:
Michael McMillan
2022-10-18 09:16:22 +02:00
committed by GitHub
parent 4cbcc59461
commit 3c31f023ce
2 changed files with 11 additions and 0 deletions

View File

@@ -102,6 +102,14 @@ def main():
has_password=datastore.data['settings']['application']['password'] != False
)
# Monitored websites will not receive a Referer header
# when a user clicks on an outgoing link.
@app.after_request
def hide_referrer(response):
if os.getenv("HIDE_REFERER", False):
response.headers["Referrer-Policy"] = "no-referrer"
return response
# Proxy sub-directory support
# Set environment var USE_X_SETTINGS=1 on this script
# And then in your proxy_pass settings