2
0

test_http3-global-disabled.py 828 B

12345678910111213141516171819
  1. import re
  2. # Python Requests is not able to do native http3 requests.
  3. # We only check for directives which should enable http3.
  4. def test_http3_global_disabled_ALTSVC_header(docker_compose, nginxproxy):
  5. r = nginxproxy.get("http://http3-global-disabled.nginx-proxy.tld/headers")
  6. assert r.status_code == 200
  7. assert "Host: http3-global-disabled.nginx-proxy.tld" in r.text
  8. assert not "alt-svc" in r.headers
  9. def test_http3_global_disabled_config(docker_compose, nginxproxy):
  10. conf = nginxproxy.get_conf().decode('ASCII')
  11. r = nginxproxy.get("http://http3-global-disabled.nginx-proxy.tld")
  12. assert r.status_code == 200
  13. assert not re.search(r"(?s)listen 443 quic", conf)
  14. assert not re.search(r"(?s)http3 on", conf)
  15. assert not re.search(r"(?s)add_header alt-svc \'h3=\":443\"; ma=86400;\'", conf)