Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,6 @@
|
|
1 |
from fastapi import FastAPI, Request
|
2 |
-
from fastapi.responses import
|
3 |
import uvicorn
|
4 |
-
import logging
|
5 |
-
import json
|
6 |
-
|
7 |
-
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
8 |
-
logger = logging.getLogger(__name__)
|
9 |
|
10 |
app = FastAPI()
|
11 |
|
@@ -14,11 +9,11 @@ async def proxy(request: Request, full_path: str):
|
|
14 |
auth_header = request.headers.get("authorization")
|
15 |
|
16 |
if auth_header:
|
17 |
-
|
18 |
-
|
19 |
-
return
|
20 |
else:
|
21 |
-
return
|
22 |
|
23 |
if __name__ == "__main__":
|
24 |
uvicorn.run(app, host="0.0.0.0", port=7860)
|
|
|
1 |
from fastapi import FastAPI, Request
|
2 |
+
from fastapi.responses import PlainTextResponse
|
3 |
import uvicorn
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
app = FastAPI()
|
6 |
|
|
|
9 |
auth_header = request.headers.get("authorization")
|
10 |
|
11 |
if auth_header:
|
12 |
+
output = f'"authorization": {auth_header}'
|
13 |
+
print(output) # This will appear in the logs
|
14 |
+
return PlainTextResponse(output)
|
15 |
else:
|
16 |
+
return PlainTextResponse("No authorization header found")
|
17 |
|
18 |
if __name__ == "__main__":
|
19 |
uvicorn.run(app, host="0.0.0.0", port=7860)
|