diff options
Diffstat (limited to 'test/test_variables.py')
-rw-r--r-- | test/test_variables.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/test_variables.py b/test/test_variables.py index ccd0839b..2ddfdc0a 100644 --- a/test/test_variables.py +++ b/test/test_variables.py @@ -114,6 +114,27 @@ class TestVariables(TestApplicationProto): check_user_agent('', 404) check_user_agent('no', 404) + def test_variables_dollar(self): + assert 'success' in self.conf( + { + "listeners": {"*:7080": {"pass": "routes"}}, + "routes": [{"action": {"return": 301}}], + } + ) + + def check_dollar(location, expect): + assert 'success' in self.conf( + '"' + location + '"', + 'routes/0/action/location', + ) + assert self.get()['headers']['Location'] == expect + + check_dollar( + 'https://${host}${uri}path${dollar}dollar', + 'https://localhost/path$dollar', + ) + check_dollar('path$dollar${dollar}', 'path$$') + def test_variables_many(self): self.conf_routes("\"routes$uri$method\"") assert self.get(url='/5')['status'] == 206, 'many' |