Skip to content

Commit

Permalink
Add args escaping if parse_args is on
Browse files Browse the repository at this point in the history
  • Loading branch information
dedok committed Feb 13, 2017
1 parent 494ce38 commit f9926eb
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 10 deletions.
7 changes: 7 additions & 0 deletions test/ngx_confs/tnt_server_test.conf
Original file line number Diff line number Diff line change
Expand Up @@ -218,5 +218,12 @@ http {
tnt_method update;
tnt_pass tnt;
}

location /unescape {
tnt_http_rest_methods get;
tnt_pass_http_request parse_args unescape;
tnt_method echo_1;
tnt_pass tnt;
}
}
}
21 changes: 11 additions & 10 deletions test/test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,6 @@ function rest_api_parse_query_args(http_request_full)
return {http_request_full}
end

box.cfg {
log_level = 5;
listen = 9999;
wal_mode = 'none';
}

box.once('gr', function()
box.schema.user.grant('guest', 'read,write,execute', 'universe')
end)

-- BUG -- https://github.com/tarantool/nginx_upstream_module/issues/37 [[
function read(http_request_full)
return {
Expand Down Expand Up @@ -140,3 +130,14 @@ function test_headers_out(req)
end
return true
end

-- CFG
box.cfg {
log_level = 5;
listen = 9999;
wal_mode = 'none';
}

box.once('gr', function()
box.schema.user.grant('guest', 'read,write,execute', 'universe')
end)
10 changes: 10 additions & 0 deletions test/v24_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,13 @@
print('[+] Headers out')
preset_method_location = BASE_URL + '/headers_out'
post_success(preset_method_location, {"body": True}, {})

# ============
#
print('[+] Unescape issue')
arg_a = 'some string with spaces'
preset_method_location = BASE_URL + '/unescape?a=' + arg_a
result = get_success(preset_method_location, None, {})
result = result[0]
assert(result['args']['a'] == arg_a), 'does not expected (args.a)'

0 comments on commit f9926eb

Please sign in to comment.