79759792

Date: 2025-09-09 10:56:16
Score: 1
Natty:
Report link

In my case adding nginx headers and fastapi config for the proxy headers did not work.

I had to hardcode the replacement of http to https in the 307 redirect responses (through a middleware) as follows:

if response.status_code == 307 
   and request.headers.get("x-forwarded-proto") == "https":
   response.headers["Location"] = response.headers["Location"].replace('http://', 'https://')
Reasons:
  • Blacklisted phrase (1): did not work
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: LiriB