temp probe: allow token exchange
Browse files
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
# 临时出口探针:只转发到 mp-staging.kaggle.net / ipinfo.io,Kaggle key 放 X-Kaggle-Auth
|
| 2 |
import json, os, hmac, urllib.request, urllib.error
|
| 3 |
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
|
| 4 |
-
ALLOWED = ("https://mp-staging.kaggle.net/", "https://ipinfo.io/")
|
| 5 |
class H(BaseHTTPRequestHandler):
|
| 6 |
def _go(self, method):
|
| 7 |
if not hmac.compare_digest(self.headers.get("X-Probe", ""), os.environ.get("PROBE_SECRET", "-")):
|
|
|
|
| 1 |
# 临时出口探针:只转发到 mp-staging.kaggle.net / ipinfo.io,Kaggle key 放 X-Kaggle-Auth
|
| 2 |
import json, os, hmac, urllib.request, urllib.error
|
| 3 |
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
|
| 4 |
+
ALLOWED = ("https://mp-staging.kaggle.net/", "https://ipinfo.io/", "https://api.kaggle.com/v1/models.ModelProxyApiService/")
|
| 5 |
class H(BaseHTTPRequestHandler):
|
| 6 |
def _go(self, method):
|
| 7 |
if not hmac.compare_digest(self.headers.get("X-Probe", ""), os.environ.get("PROBE_SECRET", "-")):
|