Skip to content

Commit

Permalink
Handle nil body data in nethermind rpc request (#4624)
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacsolo committed Jan 19, 2023
1 parent 2dd7321 commit b525077
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions discovery-provider/nginx_conf/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,14 @@ function _M.validate_nethermind_rpc_request ()
return
end
ngx.req.read_body()
local body = cjson.decode(ngx.req.get_body_data())
is_bad = utils.starts_with(body.method, "clique_")
if is_bad then
ngx.exit(405)

local data = ngx.req.get_body_data()
if data then
local body = cjson.decode(data)
is_bad = utils.starts_with(body.method, "clique_")
if is_bad then
ngx.exit(405)
end
end
end

Expand Down

0 comments on commit b525077

Please sign in to comment.