diff options
author | Andrei Zeliankou <zelenkov@nginx.com> | 2023-06-14 18:30:40 +0100 |
---|---|---|
committer | Andrei Zeliankou <zelenkov@nginx.com> | 2023-06-14 18:30:40 +0100 |
commit | 0461e804c1d295b7bae0999f786d57c0ace47e64 (patch) | |
tree | 963bffac15e0d118c41ef389526b39c9aebda9e8 | |
parent | c183bd8749a19477390f8cb77efe5f6d223f0905 (diff) | |
download | unit-0461e804c1d295b7bae0999f786d57c0ace47e64.tar.gz unit-0461e804c1d295b7bae0999f786d57c0ace47e64.tar.bz2 |
Tests: no caching for $uri variable.
-rw-r--r-- | test/test_variables.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/test_variables.py b/test/test_variables.py index a4c5446d..7322a802 100644 --- a/test/test_variables.py +++ b/test/test_variables.py @@ -1,3 +1,5 @@ +import os +from pathlib import Path import re import time @@ -122,6 +124,27 @@ def test_variables_uri(search_in_file, wait_for_record): check_uri('/9?q#a', '/9') +def test_variables_uri_no_cache(temp_dir): + os.makedirs(f'{temp_dir}/foo/bar') + Path(f'{temp_dir}/foo/bar/index.html').write_text('index') + + assert 'success' in client.conf( + { + "listeners": {"*:7080": {"pass": "routes"}}, + "routes": [ + { + "action": { + "rewrite": "/foo${uri}/", + "share": f'{temp_dir}$uri', + } + } + ], + } + ) + + assert client.get(url='/bar')['status'] == 200 + + def test_variables_host(search_in_file, wait_for_record): set_format('$host') |