about summary refs log tree commit diff
path: root/nixos/tests/custom-ca.nix
diff options
context:
space:
mode:
authorLuke Granger-Brown <git@lukegb.com>2021-05-02 21:38:56 +0000
committerLuke Granger-Brown <git@lukegb.com>2021-05-02 21:38:56 +0000
commitda000ae239717183f31bd015406e577f167739ad (patch)
treeb801c4c962c437d3256bb5ef9599f8640c290193 /nixos/tests/custom-ca.nix
parente3ad419b87019f7a3cbfd8c8cda88b104a0c7c9b (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.
Diffstat (limited to 'nixos/tests/custom-ca.nix')
-rw-r--r--nixos/tests/custom-ca.nix10
1 files changed, 8 insertions, 2 deletions
diff --git a/nixos/tests/custom-ca.nix b/nixos/tests/custom-ca.nix
index 67f7b3ff1f161..31909188d3a78 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;