forked from LBRYCommunity/lbry-sdk
block api calls from bad origins
This commit is contained in:
parent
1215470cc1
commit
6ea1f6f78c
1 changed files with 5 additions and 0 deletions
|
@ -394,6 +394,11 @@ class LBRYDaemon(jsonrpc.JSONRPC):
|
||||||
log.debug(err.getTraceback())
|
log.debug(err.getTraceback())
|
||||||
|
|
||||||
def render(self, request):
|
def render(self, request):
|
||||||
|
origin = request.getHeader("Origin")
|
||||||
|
if origin not in [None, 'http://localhost:5279']:
|
||||||
|
log.warning("Attempted api call from %s", origin)
|
||||||
|
return server.failure
|
||||||
|
|
||||||
request.content.seek(0, 0)
|
request.content.seek(0, 0)
|
||||||
# Unmarshal the JSON-RPC data.
|
# Unmarshal the JSON-RPC data.
|
||||||
content = request.content.read()
|
content = request.content.read()
|
||||||
|
|
Loading…
Reference in a new issue