]> git.ipfire.org Git - thirdparty/httpx.git/commit
Handle default ports in WSGITransport (#1469)
authorAber <me@abersheeran.com>
Tue, 16 Feb 2021 12:33:17 +0000 (20:33 +0800)
committerGitHub <noreply@github.com>
Tue, 16 Feb 2021 12:33:17 +0000 (13:33 +0100)
commit02a692aba574a8e1ea7abd6fdfbfa77258ad8e6e
tree337ae3cf811b8402a8a5e3e393fceb6eb630fb12
parentd964343fa14852bcf475a83ef9774f8c388317d7
Handle default ports in WSGITransport (#1469)

* Maybe port is `None`

https://www.python.org/dev/peps/pep-3333/#environ-variables

> SERVER_NAME, SERVER_PORT
> When HTTP_HOST is not set, these variables can be combined to determine a default. See the URL Reconstruction section below for more detail. SERVER_NAME and SERVER_PORT are required strings and must never be empty.

* Add unit test

* Compute default port

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
httpx/_transports/wsgi.py
tests/test_wsgi.py