tarantool / nginx_upstream_module

Tarantool NginX upstream module (REST, JSON API, websockets, load balancing)
Other
174 stars 18 forks source link

Sign plus in URL after '?' not converted to space #98

Closed rekzi closed 6 years ago

rekzi commented 7 years ago

If you are russian spoken, look - https://github.com/sat2707/hlcupdocs/issues/81

dedok commented 7 years ago

Hi! Can you send me a test case?

rekzi commented 7 years ago

*.conf

upstream backend {
    server 127.0.0.1:1111;
}
server { #...
location /get_something {
      tnt_http_rest_methods post;
      tnt_pass_http_request on parse_args unescape pass_body;
      tnt_method get_something;
      tnt_pass backend;
      tnt_pure_result on;
      internal;
}
location /open {
      lua_need_request_body on;
      rewrite_by_lua_block {

local res = ngx.location.capture('/get_something', {
    args = ngx.var.args,
    method = ngx.HTTP_POST,
    always_forward_body = true
})

-- ...
      }
}}

Tarantool Lua script

function get_something (req)
    local get_arg = req.args.getArg
    -- ?getArg=a+b => string 'a+b', but must be 'a b'
end
dedok commented 7 years ago

Thx you! I will fix this issue after my vacation end, that will happen in next monday.

dedok commented 6 years ago

Fixed in b108c1ea8709adf36664c75028db794e1ffbf336