mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2025-11-03 16:17:51 +00:00
Compare commits
1 Commits
browserste
...
HIDE_REFER
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6cad2d9422 |
@@ -2,19 +2,20 @@
|
|||||||
|
|
||||||
# Launch as a eventlet.wsgi server instance.
|
# Launch as a eventlet.wsgi server instance.
|
||||||
|
|
||||||
|
from distutils.util import strtobool
|
||||||
|
import eventlet
|
||||||
|
import eventlet.wsgi
|
||||||
import getopt
|
import getopt
|
||||||
import os
|
import os
|
||||||
import signal
|
import signal
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import eventlet
|
|
||||||
import eventlet.wsgi
|
|
||||||
from . import store, changedetection_app, content_fetcher
|
from . import store, changedetection_app, content_fetcher
|
||||||
from . import __version__
|
from . import __version__
|
||||||
|
|
||||||
# Only global so we can access it in the signal handler
|
# Only global so we can access it in the signal handler
|
||||||
datastore = None
|
|
||||||
app = None
|
app = None
|
||||||
|
datastore = None
|
||||||
|
|
||||||
def sigterm_handler(_signo, _stack_frame):
|
def sigterm_handler(_signo, _stack_frame):
|
||||||
global app
|
global app
|
||||||
@@ -106,8 +107,9 @@ def main():
|
|||||||
# @Note: Incompatible with password login (and maybe other features) for now, submit a PR!
|
# @Note: Incompatible with password login (and maybe other features) for now, submit a PR!
|
||||||
@app.after_request
|
@app.after_request
|
||||||
def hide_referrer(response):
|
def hide_referrer(response):
|
||||||
if os.getenv("HIDE_REFERER", False):
|
if strtobool(os.getenv("HIDE_REFERER", False)):
|
||||||
response.headers["Referrer-Policy"] = "no-referrer"
|
response.headers["Referrer-Policy"] = "no-referrer"
|
||||||
|
|
||||||
return response
|
return response
|
||||||
|
|
||||||
# Proxy sub-directory support
|
# Proxy sub-directory support
|
||||||
|
|||||||
@@ -24,6 +24,12 @@ echo "RUNNING WITH BASE_URL SET"
|
|||||||
export BASE_URL="https://really-unique-domain.io"
|
export BASE_URL="https://really-unique-domain.io"
|
||||||
pytest tests/test_notification.py
|
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
|
# Now for the selenium and playwright/browserless fetchers
|
||||||
# Note - this is not UI functional tests - just checking that each one can fetch the content
|
# Note - this is not UI functional tests - just checking that each one can fetch the content
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user