Blocking other sources/spaces from requesting
Browse files- TextGen/router.py +1 -1
TextGen/router.py
CHANGED
@@ -263,7 +263,7 @@ async def generate_wav(message: VoiceMessage):
|
|
263 |
|
264 |
@app.get("/generate_voice_eleven", response_class=StreamingResponse)
|
265 |
@app.post("/generate_voice_eleven", response_class=StreamingResponse)
|
266 |
-
def generate_voice_eleven(message: VoiceMessage = None
|
267 |
if request.headers.get("origin") != "https://jofthomas-everchanging-quest.static.hf.space":
|
268 |
return
|
269 |
global Last_message # Declare Last_message as global
|
|
|
263 |
|
264 |
@app.get("/generate_voice_eleven", response_class=StreamingResponse)
|
265 |
@app.post("/generate_voice_eleven", response_class=StreamingResponse)
|
266 |
+
def generate_voice_eleven(request: Request, message: VoiceMessage = None):
|
267 |
if request.headers.get("origin") != "https://jofthomas-everchanging-quest.static.hf.space":
|
268 |
return
|
269 |
global Last_message # Declare Last_message as global
|