Skip to content

Commit e78ada0

Browse files
Tests: added PHP test with rewrite and query string.
This test reproduces #964.
1 parent c433a3c commit e78ada0

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

test/test_php_application.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,36 @@ def test_php_application_query_string_empty():
171171
assert resp['headers']['Query-String'] == '', 'query string empty'
172172

173173

174+
def test_php_application_query_string_rewrite():
175+
assert 'success' in client.conf(
176+
{
177+
"listeners": {"*:7080": {"pass": "routes"}},
178+
"routes": [
179+
{
180+
"action": {
181+
"rewrite": "/new",
182+
"pass": "applications/query_string",
183+
},
184+
},
185+
],
186+
"applications": {
187+
"query_string": {
188+
"type": client.get_application_type(),
189+
"processes": {"spare": 0},
190+
"root": f"{option.test_dir}/php/query_string",
191+
"script": "index.php",
192+
}
193+
},
194+
},
195+
)
196+
197+
assert client.get(url='/old')['status'] == 200
198+
199+
resp = client.get(url='/old?arg=val')
200+
assert resp['status'] == 200
201+
assert resp['headers']['Query-String'] == 'arg=val'
202+
203+
174204
def test_php_application_fastcgi_finish_request(findall, unit_pid):
175205
client.load('fastcgi_finish_request')
176206

0 commit comments

Comments
 (0)