-3

we have hosting for multiple domains and a background redirect algorithm. redirect function is in python and checks:

request.host

in stead of returning abc.com or xyz.com now host started to return about a couple of hours ago

us-central1-functionname.cloudfunctions.net

for all hosted domians and redirects stopped.

we cannot get the correct host name any more.

2
  • This is a firebase project, using Google Cloud Functions written in Python 3.7. Has multiple custom domains.
    – Su Ferik
    Jan 5, 2021 at 13:44
  • This is off-topic here. You can ask questions about programming in Python on Stack Overflow. Jan 6, 2021 at 7:37

1 Answer 1

-1

Instead of using :

request.host or request.host_url,

use:

request.headers.get("X-Forwarded-Host") to get abc.com or xyz.com.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .