tarantool / nginx_upstream_module

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

Issue 77: allow access to raw POST data with "parse_urlencoded" enabled #134

Closed snoopcatt closed 4 years ago

snoopcatt commented 4 years ago

Problem: when you set tnt_pass_http_request to parse_args parse_urlencoded pass_body, it's impossible to access raw POST body even if there are binary file, for example.

This problem caused because parse_urlencoded conflicts with pass_body.

In this patch, I've splitted these options to allow them work together. Config parameters is backward compatible with upstream.

pass_body will allow you to access request variable body that containts unparsed request body. parse_urlencoded will allow you to access new request variable args_urlencoded that will contain table with parsed POST request (like args for GET)

NB! If you using parse_urlencoded now, you need to change req.body to req.args_urlencoded in your Lua code. If you using only pass_body, no need to change anything.

dedok commented 4 years ago

Thank you for contributing! Looks good to me.