File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -608,8 +608,9 @@ def get_protocol_from_request(request: Request) -> str:
608
608
1) X-Forwarded-Proto (if set by a proxy)
609
609
2) request.url.scheme (e.g. when Gunicorn/Uvicorn is terminating TLS)
610
610
611
- Args:
611
+ Args:
612
612
request (Request): The FastAPI request object.
613
+
613
614
Returns:
614
615
str: The protocol used for the request, either "http" or "https".
615
616
"""
@@ -626,11 +627,12 @@ def update_url_protocol(request: Request) -> str:
626
627
627
628
Args:
628
629
request (Request): The FastAPI request object.
630
+
629
631
Returns:
630
632
str: The base URL with the correct protocol.
631
633
"""
632
634
parsed = urlparse (str (request .base_url ))
633
- proto = get_protocol_from_request (request )
635
+ proto = get_protocol_from_request (request )
634
636
new_parsed = parsed ._replace (scheme = proto )
635
637
# urlunparse keeps netloc and path intact
636
638
return urlunparse (new_parsed ).rstrip ("/" )
@@ -2282,7 +2284,6 @@ async def readiness_check(db: Session = Depends(get_db)):
2282
2284
try :
2283
2285
# Run the blocking DB check in a thread to avoid blocking the event loop
2284
2286
await asyncio .to_thread (db .execute , text ("SELECT 1" ))
2285
- return JSONResponse (content = {"status" : "ready" }, status_code = 200 )
2286
2287
except Exception as e :
2287
2288
error_message = f"Readiness check failed: { str (e )} "
2288
2289
logger .error (error_message )
You can’t perform that action at this time.
0 commit comments