summaryrefslogtreecommitdiffhomepage
path: root/test/test_php_application.py
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2023-10-11 16:42:55 +0100
committerAndrei Zeliankou <zelenkov@nginx.com>2023-10-11 16:42:55 +0100
commite78ada01402a1d2e658d752cbdcc8f2602ef8826 (patch)
treea4bae2c86d13d287a0bf46feea29481a59190192 /test/test_php_application.py
parentc433a3c9145cd9e16ca61caa5bd7df159020b972 (diff)
downloadunit-e78ada01402a1d2e658d752cbdcc8f2602ef8826.tar.gz
unit-e78ada01402a1d2e658d752cbdcc8f2602ef8826.tar.bz2
Tests: added PHP test with rewrite and query string.
This test reproduces https://github.com/nginx/unit/issues/964.
Diffstat (limited to 'test/test_php_application.py')
-rw-r--r--test/test_php_application.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/test_php_application.py b/test/test_php_application.py
index 6c1f227b..17440909 100644
--- a/test/test_php_application.py
+++ b/test/test_php_application.py
@@ -171,6 +171,36 @@ def test_php_application_query_string_empty():
assert resp['headers']['Query-String'] == '', 'query string empty'
+def test_php_application_query_string_rewrite():
+ assert 'success' in client.conf(
+ {
+ "listeners": {"*:7080": {"pass": "routes"}},
+ "routes": [
+ {
+ "action": {
+ "rewrite": "/new",
+ "pass": "applications/query_string",
+ },
+ },
+ ],
+ "applications": {
+ "query_string": {
+ "type": client.get_application_type(),
+ "processes": {"spare": 0},
+ "root": f"{option.test_dir}/php/query_string",
+ "script": "index.php",
+ }
+ },
+ },
+ )
+
+ assert client.get(url='/old')['status'] == 200
+
+ resp = client.get(url='/old?arg=val')
+ assert resp['status'] == 200
+ assert resp['headers']['Query-String'] == 'arg=val'
+
+
def test_php_application_fastcgi_finish_request(findall, unit_pid):
client.load('fastcgi_finish_request')