diff options
author | Robert Hensing <roberth@users.noreply.github.com> | 2022-06-30 21:10:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-30 21:10:57 +0200 |
commit | 1e17bb943e4de2d0d08e910216d1df73ffa78754 (patch) | |
tree | fe2736d354e6b8bfb3cb49c9a29bb008bd18bc97 /pkgs/build-support/fetchurl/tests.nix | |
parent | ff3d914ad786bf484e04dfaf3990e5d6efaea12b (diff) | |
parent | 588439e1311c41a5779877d4d8ef603410b79cd4 (diff) |
Merge pull request #164662 from infinisil/fetchurl-curlOpts-list
fetchurl: Allow passing curl options with spaces
Diffstat (limited to 'pkgs/build-support/fetchurl/tests.nix')
-rw-r--r-- | pkgs/build-support/fetchurl/tests.nix | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/pkgs/build-support/fetchurl/tests.nix b/pkgs/build-support/fetchurl/tests.nix new file mode 100644 index 0000000000000..fc7fb25e158ff --- /dev/null +++ b/pkgs/build-support/fetchurl/tests.nix @@ -0,0 +1,13 @@ +{ invalidateFetcherByDrvHash, fetchurl, jq, moreutils, ... }: { + # Tests that we can send custom headers with spaces in them + header = + let headerValue = "Test '\" <- These are some quotes"; + in invalidateFetcherByDrvHash fetchurl { + url = "https://httpbin.org/headers"; + sha256 = builtins.hashString "sha256" (headerValue + "\n"); + curlOptsList = [ "-H" "Hello: ${headerValue}" ]; + postFetch = '' + ${jq}/bin/jq -r '.headers.Hello' $out | ${moreutils}/bin/sponge $out + ''; + }; +} |