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