Skip to content

Commit

Permalink
Sp nethermind web3 (#4555)
Browse files Browse the repository at this point in the history
* allow web3

* block clique rpcs

* allow OPTIONS
  • Loading branch information
stereosteve authored Jan 4, 2023
1 parent 62191ba commit 989b67a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions discovery-provider/nginx_conf/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,13 @@ function _M.mark_request_processed ()
end

function _M.validate_nethermind_rpc_request ()
if ngx.req.get_method() == "GET" then
if ngx.req.get_method() == "GET" or ngx.req.get_method() == "OPTIONS" then
return
end
ngx.req.read_body()
local body = cjson.decode(ngx.req.get_body_data())
if not utils.starts_with(body.method, "eth_") then
is_bad = utils.starts_with(body.method, "clique_")
if is_bad then
ngx.exit(405)
end
end
Expand Down

0 comments on commit 989b67a

Please sign in to comment.