diff options
Diffstat (limited to 'pkgs/build-support/fetchurl/tests.nix')
-rw-r--r-- | pkgs/build-support/fetchurl/tests.nix | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/pkgs/build-support/fetchurl/tests.nix b/pkgs/build-support/fetchurl/tests.nix index e348d77db0bd..8d9064141f23 100644 --- a/pkgs/build-support/fetchurl/tests.nix +++ b/pkgs/build-support/fetchurl/tests.nix @@ -1,11 +1,23 @@ -{ testers, fetchurl, jq, moreutils, ... }: { +{ + testers, + fetchurl, + jq, + moreutils, + ... +}: +{ # Tests that we can send custom headers with spaces in them header = - let headerValue = "Test '\" <- These are some quotes"; - in testers.invalidateFetcherByDrvHash fetchurl { + let + headerValue = "Test '\" <- These are some quotes"; + in + testers.invalidateFetcherByDrvHash fetchurl { url = "https://httpbin.org/headers"; sha256 = builtins.hashString "sha256" (headerValue + "\n"); - curlOptsList = [ "-H" "Hello: ${headerValue}" ]; + curlOptsList = [ + "-H" + "Hello: ${headerValue}" + ]; postFetch = '' ${jq}/bin/jq -r '.headers.Hello' $out | ${moreutils}/bin/sponge $out ''; |