2022-11-16 20:52:37 +01:00
|
|
|
{ testers, fetchurl, jq, moreutils, ... }: {
|
2022-06-30 19:49:54 +02:00
|
|
|
# Tests that we can send custom headers with spaces in them
|
|
|
|
header =
|
|
|
|
let headerValue = "Test '\" <- These are some quotes";
|
2022-11-16 20:52:37 +01:00
|
|
|
in testers.invalidateFetcherByDrvHash fetchurl {
|
2022-06-30 19:49:54 +02:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|