ka1kuk commited on
Commit
466745f
1 Parent(s): e66a3dd

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +1 -1
main.py CHANGED
@@ -26,7 +26,7 @@ async def proxy(url: str = Path(..., title="The URL to be proxied", description=
26
  async with httpx.AsyncClient() as client:
27
  try:
28
  response = await client.get(url, headers=headers)
29
- return response.content
30
  except httpx.RequestError as e:
31
  raise HTTPException(status_code=500, detail=f"Error fetching URL: {e}")
32
 
 
26
  async with httpx.AsyncClient() as client:
27
  try:
28
  response = await client.get(url, headers=headers)
29
+ return Response(content=response.content, media_type=response.headers.get('Content-Type'))
30
  except httpx.RequestError as e:
31
  raise HTTPException(status_code=500, detail=f"Error fetching URL: {e}")
32