We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d8eca1a commit e0f1699Copy full SHA for e0f1699
teach/learning.py
@@ -77,8 +77,10 @@ def application(environ, start_response):
77
code = qs['code'][0]
78
headers = [('Content-Type', 'application/json')]
79
origin = environ.get('HTTP_ORIGIN', '')
80
- if origin:
81
- headers.append(('Access-Control-Allow-Origin', origin))
+ if origin.find('www.liaoxuefeng.com') == -1:
+ start_response('400 Bad Request', [('Content-Type', 'application/json')])
82
+ return [b'{"error":"invalid_origin"}']
83
+ headers.append(('Access-Control-Allow-Origin', origin))
84
start_response('200 OK', headers)
85
r = dict()
86
try:
0 commit comments