Compare commits

...

1 Commits

Author SHA1 Message Date
dgtlmoon
6cad2d9422 Re-test under HIDE_REFERER, use strtobool so you can use 'False' 2022-11-12 13:38:11 +01:00
2 changed files with 12 additions and 4 deletions

View File

@@ -2,19 +2,20 @@
# Launch as a eventlet.wsgi server instance.
from distutils.util import strtobool
import eventlet
import eventlet.wsgi
import getopt
import os
import signal
import sys
import eventlet
import eventlet.wsgi
from . import store, changedetection_app, content_fetcher
from . import __version__
# Only global so we can access it in the signal handler
datastore = None
app = None
datastore = None
def sigterm_handler(_signo, _stack_frame):
global app
@@ -106,8 +107,9 @@ def main():
# @Note: Incompatible with password login (and maybe other features) for now, submit a PR!
@app.after_request
def hide_referrer(response):
if os.getenv("HIDE_REFERER", False):
if strtobool(os.getenv("HIDE_REFERER", False)):
response.headers["Referrer-Policy"] = "no-referrer"
return response
# Proxy sub-directory support

View File

@@ -24,6 +24,12 @@ echo "RUNNING WITH BASE_URL SET"
export BASE_URL="https://really-unique-domain.io"
pytest tests/test_notification.py
# Re-run with HIDE_REFERER set - could affect login
export HIDE_REFERER=True
pytest tests/test_access_control.py
# Now for the selenium and playwright/browserless fetchers
# Note - this is not UI functional tests - just checking that each one can fetch the content