diff options
author | Wojtek Kosior <koszko@koszko.org> | 2022-06-10 14:53:31 +0200 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2022-06-10 14:53:31 +0200 |
commit | 051d2472407c1dc1e6c2b88a00be04fe77da8919 (patch) | |
tree | daec6d822a65d9e9747a69a692fd608419cc8e0a /test/haketilo_test/unit | |
parent | f8dedf60638bffde3f92116db3f418d2e6260e80 (diff) | |
parent | d9441412a6052e5fb057d01b745208070f8bdfd4 (diff) | |
download | browser-extension-051d2472407c1dc1e6c2b88a00be04fe77da8919.tar.gz browser-extension-051d2472407c1dc1e6c2b88a00be04fe77da8919.zip |
merge support for CORS bypassing and eval()
Diffstat (limited to 'test/haketilo_test/unit')
-rw-r--r-- | test/haketilo_test/unit/test_patterns.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/haketilo_test/unit/test_patterns.py b/test/haketilo_test/unit/test_patterns.py index f2eeaf8..2ba4dce 100644 --- a/test/haketilo_test/unit/test_patterns.py +++ b/test/haketilo_test/unit/test_patterns.py @@ -103,6 +103,9 @@ def test_deconstruct_url(execute_in_page): assert deco['domain'] == ['example', 'com'] assert deco['path'] == ['a', 'b'] + reco = execute_in_page('returnval(reconstruct_url(arguments[0]));', deco) + assert reco == 'https://example.com/a/b' + deco = execute_in_page('returnval(deconstruct_url(arguments[0]));', 'http://**.example.com/') assert deco @@ -111,6 +114,9 @@ def test_deconstruct_url(execute_in_page): assert deco['domain'] == ['**', 'example', 'com'] assert deco['path'] == [] + reco = execute_in_page('returnval(reconstruct_url(arguments[0]));', deco) + assert reco == 'http://**.example.com/' + deco = execute_in_page('returnval(deconstruct_url(arguments[0]));', 'ftp://user@ftp.example.com/all///passwords.txt/') assert deco @@ -119,6 +125,9 @@ def test_deconstruct_url(execute_in_page): assert deco['domain'] == ['ftp', 'example', 'com'] assert deco['path'] == ['all', 'passwords.txt'] + reco = execute_in_page('returnval(reconstruct_url(arguments[0]));', deco) + assert reco == 'ftp://ftp.example.com/all/passwords.txt/' + deco = execute_in_page('returnval(deconstruct_url(arguments[0]));', 'ftp://mirror.edu.pl.eu.org') assert deco @@ -127,6 +136,9 @@ def test_deconstruct_url(execute_in_page): assert deco['domain'] == ['mirror', 'edu', 'pl', 'eu', 'org'] assert deco['path'] == [] + reco = execute_in_page('returnval(reconstruct_url(arguments[0]));', deco) + assert reco == 'ftp://mirror.edu.pl.eu.org' + deco = execute_in_page('returnval(deconstruct_url(arguments[0]));', 'file:///mnt/parabola_chroot///etc/passwd') assert deco @@ -135,6 +147,9 @@ def test_deconstruct_url(execute_in_page): assert deco['path'] == ['mnt', 'parabola_chroot', 'etc', 'passwd'] assert 'domain' not in deco + reco = execute_in_page('returnval(reconstruct_url(arguments[0]));', deco) + assert reco == 'file:///mnt/parabola_chroot/etc/passwd' + for bad_url in [ '://bad-url.missing/protocol', 'http:/example.com/a/b', |