Muhammad Saqib commited on
Commit
29dae34
1 Parent(s): d803483

Update modules/app.py

Browse files
Files changed (1) hide show
  1. modules/app.py +1 -1
modules/app.py CHANGED
@@ -19,6 +19,7 @@ allowed_user_agent = os.getenv("ALLOWED_USER_AGENT")
19
 
20
 
21
  async def verify_user_agent(request: Request):
 
22
  user_agent = request.headers.get('User-Agent', None)
23
  if user_agent != allowed_user_agent:
24
  raise HTTPException(status_code=403, detail="Access denied")
@@ -229,7 +230,6 @@ async def pixart_sigma(request: Request):
229
  line = line.replace('data: ', '')
230
  line_json = json.loads(line)
231
  if line_json["msg"] == "process_completed":
232
- print(line_json)
233
  image_url = line_json["output"]["data"][0][0]["image"]["url"]
234
  return {"image_url": image_url}
235
  except:
 
19
 
20
 
21
  async def verify_user_agent(request: Request):
22
+ print(request.headers)
23
  user_agent = request.headers.get('User-Agent', None)
24
  if user_agent != allowed_user_agent:
25
  raise HTTPException(status_code=403, detail="Access denied")
 
230
  line = line.replace('data: ', '')
231
  line_json = json.loads(line)
232
  if line_json["msg"] == "process_completed":
 
233
  image_url = line_json["output"]["data"][0][0]["image"]["url"]
234
  return {"image_url": image_url}
235
  except: