How does flask know the right server name?

I tried using flask.url_for(..., _external=True) and the output had the right project domain. How?

Supposedly it looks at SERVER_NAME, but that’s not set.

oh, it probably gets it from the Host request header