mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-28 14:22:50 +03:00
fetchurl: Add curlOptsList test
This commit is contained in:
parent
b404704911
commit
588439e131
13
pkgs/build-support/fetchurl/tests.nix
Normal file
13
pkgs/build-support/fetchurl/tests.nix
Normal file
@ -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
|
||||
'';
|
||||
};
|
||||
}
|
@ -27,6 +27,7 @@ with pkgs;
|
||||
cc-multilib-gcc = callPackage ./cc-wrapper/multilib.nix { stdenv = gccMultiStdenv; };
|
||||
cc-multilib-clang = callPackage ./cc-wrapper/multilib.nix { stdenv = clangMultiStdenv; };
|
||||
|
||||
fetchurl = callPackages ../build-support/fetchurl/tests.nix { };
|
||||
fetchpatch = callPackages ../build-support/fetchpatch/tests.nix { };
|
||||
fetchgit = callPackages ../build-support/fetchgit/tests.nix { };
|
||||
fetchFirefoxAddon = callPackages ../build-support/fetchfirefoxaddon/tests.nix { };
|
||||
|
Loading…
Reference in New Issue
Block a user