Skip to content

Commit 067c399

Browse files
committed
handle allow_origin='*' in check_referrer
allow_origin can be the wildcard '*' to allow any host check_referer should match check_origin
1 parent eb2b4c6 commit 067c399

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

notebook/base/handlers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,10 @@ def check_referer(self):
404404
Used on GET for api endpoints and /files/
405405
to block cross-site inclusion (XSSI).
406406
"""
407+
408+
if self.allow_origin == "*" or self.skip_check_origin():
409+
return True
410+
407411
host = self.request.headers.get("Host")
408412
referer = self.request.headers.get("Referer")
409413

0 commit comments

Comments
 (0)