Skip to content

allow read of chunked request in lua #488

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions src/ngx_http_lua_socket_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -4084,14 +4084,6 @@ ngx_http_lua_req_socket(lua_State *L)
}
#endif

#if nginx_version >= 1003009
if (!raw && r->headers_in.chunked) {
lua_pushnil(L);
lua_pushliteral(L, "chunked request bodies not supported yet");
return 2;
}
#endif

ctx = ngx_http_get_module_ctx(r, ngx_http_lua_module);
if (ctx == NULL) {
return luaL_error(L, "no ctx found");
Expand Down Expand Up @@ -4175,7 +4167,11 @@ ngx_http_lua_req_socket(lua_State *L)

dd("req content length: %d", (int) r->headers_in.content_length_n);

#if nginx_version >= 1003009
if (!r->headers_in.chunked && r->headers_in.content_length_n <= 0) {
#else
if (r->headers_in.content_length_n <= 0) {
#endif
lua_pushnil(L);
lua_pushliteral(L, "no body");
return 2;
Expand Down