Spaces:
Starting
Starting
Update main.py
Browse files
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 |
|