Skip to content

Commit

Permalink
Update request.lua
Browse files Browse the repository at this point in the history
fix BUG
  • Loading branch information
jx-sec committed Feb 28, 2019
1 parent 6200eb3 commit 8a94986
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/resty/jxwaf/request.lua
Expand Up @@ -81,11 +81,11 @@ local function _parse_request_body()
ngx.log(ngx.ERR,"request body size larger than client_body_buffer_size, refuse request ")
ngx.exit(503)
end
if content_type and ngx.re.find(content_type, [=[^multipart/form-data]=],"oij") and tonumber(ngx.req.get_headers()["Content-Length"]) ~= 0 then
if content_type and ngx.re.find(content_type, [=[^multipart/form-data]=],"oij") and ngx.req.get_headers()["Content-Length"] and tonumber(ngx.req.get_headers()["Content-Length"]) ~= 0 then
ngx.ctx.parse_request_body = {}
return {}
end
if content_type and ngx.re.find(content_type, [=[^application/json;]=],"oij") and tonumber(ngx.req.get_headers()["Content-Length"]) ~= 0 then
if content_type and ngx.re.find(content_type, [=[^application/json;]=],"oij") and ngx.req.get_headers()["Content-Length"] and tonumber(ngx.req.get_headers()["Content-Length"]) ~= 0 then

-- local body_data = ngx.req.get_post_args()
local json_args_raw = ngx.req.get_body_data()
Expand Down

0 comments on commit 8a94986

Please sign in to comment.