1
0
mirror of https://github.com/nginx-proxy/nginx-proxy synced 2024-11-08 07:49:22 +01:00

Merge pull request #2393 from SchoNie/tests-nonstandardport-hostheader

tests: non standard port Host header check
This commit is contained in:
Nicolas Duchon 2024-02-13 18:23:14 +01:00 committed by GitHub
commit 5c0c8c93d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 2 deletions

@ -5,4 +5,9 @@ import pytest
def test_web1_http_custom_port(docker_compose, nginxproxy, subdomain):
r = nginxproxy.get("http://%s.nginx-proxy.tld:8080/port" % subdomain, allow_redirects=False)
assert r.status_code == 200
assert "answer from port 81\n" in r.text
assert "answer from port 81\n" in r.text
def test_nonstandardport_Host_header(docker_compose, nginxproxy):
r = nginxproxy.get("http://web.nginx-proxy.tld:8080/headers")
assert r.status_code == 200
assert "Host: web.nginx-proxy.tld:8080" in r.text

@ -11,4 +11,9 @@ def test_web1_http_redirects_to_https(docker_compose, nginxproxy, subdomain):
def test_web1_https_is_forwarded(docker_compose, nginxproxy, subdomain):
r = nginxproxy.get("https://%s.nginx-proxy.tld:8443/port" % subdomain, allow_redirects=False)
assert r.status_code == 200
assert "answer from port 81\n" in r.text
assert "answer from port 81\n" in r.text
def test_nonstandardport_Host_header(docker_compose, nginxproxy):
r = nginxproxy.get("https://web.nginx-proxy.tld:8443/headers")
assert r.status_code == 200
assert "Host: web.nginx-proxy.tld:8443" in r.text