diff options
author | Luke Granger-Brown <git@lukegb.com> | 2021-05-02 21:38:56 +0000 |
---|---|---|
committer | Luke Granger-Brown <git@lukegb.com> | 2021-05-02 21:38:56 +0000 |
commit | da000ae239717183f31bd015406e577f167739ad (patch) | |
tree | b801c4c962c437d3256bb5ef9599f8640c290193 | |
parent | e3ad419b87019f7a3cbfd8c8cda88b104a0c7c9b (diff) |
nixos/tests/custom-ca: fix by setting Content-Type
This test was failing because Firefox was displaying a download prompt
rather than the page content, presumably because mumble mumble
content-type sniffing.
By explicitly setting a content-type, the test now passes.
-rw-r--r-- | nixos/tests/custom-ca.nix | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/nixos/tests/custom-ca.nix b/nixos/tests/custom-ca.nix index 67f7b3ff1f16..31909188d3a7 100644 --- a/nixos/tests/custom-ca.nix +++ b/nixos/tests/custom-ca.nix @@ -92,13 +92,19 @@ in { onlySSL = true; sslCertificate = "${example-good-cert}/server.crt"; sslCertificateKey = "${example-good-cert}/server.key"; - locations."/".extraConfig = "return 200 'It works!';"; + locations."/".extraConfig = '' + add_header Content-Type text/plain; + return 200 'It works!'; + ''; }; services.nginx.virtualHosts."bad.example.com" = { onlySSL = true; sslCertificate = "${example-bad-cert}/server.crt"; sslCertificateKey = "${example-bad-cert}/server.key"; - locations."/".extraConfig = "return 200 'It does not work!';"; + locations."/".extraConfig = '' + add_header Content-Type text/plain; + return 200 'It does not work!'; + ''; }; environment.systemPackages = with pkgs; |