Spaces:
Running
on
Zero
Running
on
Zero
Lord-Raven
commited on
Commit
·
f3bcef9
1
Parent(s):
0be7de7
Blocking requests from other origins.
Browse files
app.py
CHANGED
@@ -32,8 +32,8 @@ classifier = pipeline(task="zero-shot-classification", model=model, tokenizer=to
|
|
32 |
def zero_shot_classification(data_string, request: gradio.Request):
|
33 |
if request:
|
34 |
print("Request headers dictionary:", request.headers)
|
35 |
-
if request.headers["origin"] not in ["https://jhuhman-statosphere-backend.hf.space"]:
|
36 |
-
return ""
|
37 |
print(data_string)
|
38 |
data = json.loads(data_string)
|
39 |
print(data)
|
|
|
32 |
def zero_shot_classification(data_string, request: gradio.Request):
|
33 |
if request:
|
34 |
print("Request headers dictionary:", request.headers)
|
35 |
+
if request.headers["origin"] not in ["https://statosphere-3704059fdd7e.c5v4v4jx6pq5.win", "https://jhuhman-statosphere-backend.hf.space"]:
|
36 |
+
return "{}"
|
37 |
print(data_string)
|
38 |
data = json.loads(data_string)
|
39 |
print(data)
|