From da000ae239717183f31bd015406e577f167739ad Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sun, 2 May 2021 21:38:56 +0000 Subject: [PATCH] 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. --- nixos/tests/custom-ca.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nixos/tests/custom-ca.nix b/nixos/tests/custom-ca.nix index 67f7b3ff1f1..31909188d3a 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;