Sanic Ip Whitelist

[Solved] Sanic Ip Whitelist | Solidity - Code Explorer | yomemimo.com
Question : sanic ip whitelist

Answered by : janole-michael

whitelist = ["127.0.0.1"]
@app.on_request
async def on_request(request): user_ip = request.remote_addr or request.ip if (not user_ip in whitelist): return text("Nice try", status=403) # 403 = forbidden # no need to write an else; the requested method will run.

Source : | Last Update : Mon, 20 Jun 22

Answers related to sanic ip whitelist

Code Explorer Popular Question For Solidity