Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing POST request #77

Closed
fsitedev opened this issue Mar 27, 2017 · 4 comments · Fixed by #134
Closed

Parsing POST request #77

fsitedev opened this issue Mar 27, 2017 · 4 comments · Fixed by #134
Assignees

Comments

@fsitedev
Copy link

As a continuation of the issue
#76 I can suggest to parse the POST body and transfer resulting arguments into lua procedure.
It seems quite logical for modern web application to have such common things like request headers, GET-POST params and etc. not only in raw form but in commonly-used parsed variant.
As an Idea I can suggest to alter some options of "tnt_pass_http_request" directive:

  • Rename "pass_body" to "pass_raw_body" only to show an explicit behaviour when no parsing applied in this case.
  • Make "parse_body" (as analogue of parse_args). This option could enable automatic encoding resolvation. There are 3 common html-form encodings for now:
    • x-www-urlencoded (default if skipped)
    • multipart/form-data (no encoding, split by boundaries)
    • text-plain (spaces replaced with "+")

So as not to die from so much work, we can start from only one encoding and add others one by one.
I'm sure this feature will make "tnt/nginx_upstream" much more convinient for end-level lua applications, which still suffer from heavy text-parsing tasks and will let them focus on it's logic only

@dedok
Copy link
Contributor

dedok commented Aug 17, 2017

x-www-urlencoded (default if skipped) in 1f05736

@dedok
Copy link
Contributor

dedok commented Aug 17, 2017

You can found details in readme, here is a link https://github.com/tarantool/nginx_upstream_module#tnt_pass_http_request, check the parse_urlencoded

@snoopcatt
Copy link
Contributor

Added pull request that allow access to raw POST body even with parse_urlencoded enabled.
In my branch with parse_urlencoded there are new request variable — args_urlencoded, and you still have access to raw body value.

@dedok
Copy link
Contributor

dedok commented Nov 6, 2019

Yeah, I guess we can close this one. Thank you so much!

@dedok dedok closed this as completed Nov 6, 2019
romanhabibov added a commit that referenced this issue Dec 14, 2020
Fix unjustified changes in 26e5554.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants