1 import ./make-test-python.nix {
2 name = "nginx-more-headers";
5 webserver = { pkgs, ... }: {
11 "/".return = "200 blub";
15 more_set_headers "Referrer-Policy: no-referrer";
20 more_set_headers "X-Powered-By: nixos";
28 webserver.wait_for_unit("nginx")
29 webserver.wait_for_open_port(80)
31 webserver.succeed("curl --fail --resolve test:80:127.0.0.1 --head --verbose http://test | grep -q \"X-Powered-By: nixos\"")
32 webserver.fail("curl --fail --resolve test:80:127.0.0.1 --head --verbose http://test | grep -q \"Referrer-Policy: no-referrer\"")
34 webserver.succeed("curl --fail --resolve test:80:127.0.0.1 --head --verbose http://test/some | grep -q \"X-Powered-By: nixos\"")
35 webserver.succeed("curl --fail --resolve test:80:127.0.0.1 --head --verbose http://test/some | grep -q \"Referrer-Policy: no-referrer\"")