Test: Re-test under HIDE_REFERER condition, use strtobool so you can use 'False' (#1121)

pull/1128/head
dgtlmoon 2 years ago committed by GitHub
parent 359dcb63e3
commit 85d8d57997
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

@ -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

Loading…
Cancel
Save