Skip to content

Commit f9926eb

Browse files
committed
Add args escaping if parse_args is on
1 parent 494ce38 commit f9926eb

File tree

3 files changed

+28
-10
lines changed

3 files changed

+28
-10
lines changed

test/ngx_confs/tnt_server_test.conf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,5 +218,12 @@ http {
218218
tnt_method update;
219219
tnt_pass tnt;
220220
}
221+
222+
location /unescape {
223+
tnt_http_rest_methods get;
224+
tnt_pass_http_request parse_args unescape;
225+
tnt_method echo_1;
226+
tnt_pass tnt;
227+
}
221228
}
222229
}

test/test.lua

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,6 @@ function rest_api_parse_query_args(http_request_full)
3838
return {http_request_full}
3939
end
4040

41-
box.cfg {
42-
log_level = 5;
43-
listen = 9999;
44-
wal_mode = 'none';
45-
}
46-
47-
box.once('gr', function()
48-
box.schema.user.grant('guest', 'read,write,execute', 'universe')
49-
end)
50-
5141
-- BUG -- https://github.com/tarantool/nginx_upstream_module/issues/37 [[
5242
function read(http_request_full)
5343
return {
@@ -140,3 +130,14 @@ function test_headers_out(req)
140130
end
141131
return true
142132
end
133+
134+
-- CFG
135+
box.cfg {
136+
log_level = 5;
137+
listen = 9999;
138+
wal_mode = 'none';
139+
}
140+
141+
box.once('gr', function()
142+
box.schema.user.grant('guest', 'read,write,execute', 'universe')
143+
end)

test/v24_features.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,13 @@
3737
print('[+] Headers out')
3838
preset_method_location = BASE_URL + '/headers_out'
3939
post_success(preset_method_location, {"body": True}, {})
40+
41+
# ============
42+
#
43+
print('[+] Unescape issue')
44+
arg_a = 'some string with spaces'
45+
preset_method_location = BASE_URL + '/unescape?a=' + arg_a
46+
result = get_success(preset_method_location, None, {})
47+
result = result[0]
48+
assert(result['args']['a'] == arg_a), 'does not expected (args.a)'
49+

0 commit comments

Comments
 (0)