nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ testers, fetchurl, jq, moreutils, ... }: {
2 # Tests that we can send custom headers with spaces in them
3 header =
4 let headerValue = "Test '\" <- These are some quotes";
5 in testers.invalidateFetcherByDrvHash fetchurl {
6 url = "https://httpbin.org/headers";
7 sha256 = builtins.hashString "sha256" (headerValue + "\n");
8 curlOptsList = [ "-H" "Hello: ${headerValue}" ];
9 postFetch = ''
10 ${jq}/bin/jq -r '.headers.Hello' $out | ${moreutils}/bin/sponge $out
11 '';
12 };
13}