Skip to content

Commit

Permalink
Security check - improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
dgtlmoon committed Nov 7, 2024
1 parent 6aceeb0 commit 7512392
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions changedetectionio/tests/test_security.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_bad_access(client, live_server, measure_memory_usage):
def test_file_slashslash_access(client, live_server, measure_memory_usage):
#live_server_setup(live_server)

test_file_path = "/tmp/test-file.txt"
test_file_path = os.path.abspath(__file__)

# file:// is permitted by default, but it will be caught by ALLOW_FILE_URI
client.post(
Expand All @@ -82,8 +82,7 @@ def test_file_slashslash_access(client, live_server, measure_memory_usage):
follow_redirects=True
)

# Should see something (this file added by run_basic_tests.sh)
assert b"Hello world" in res.data
assert b"test_file_slashslash_access" in res.data
else:
# Default should be here
assert b'file:// type access is denied for security reasons.' in res.data
Expand All @@ -109,8 +108,7 @@ def test_file_slash_access(client, live_server, measure_memory_usage):
follow_redirects=True
)

# Should see something (this file added by run_basic_tests.sh)
assert b"Hello world" in res.data
assert b"test_file_slash_access" in res.data
else:
# Default should be here
assert b'file:// type access is denied for security reasons.' in res.data
Expand Down

0 comments on commit 7512392

Please sign in to comment.