Skip to content
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.

Commit

Permalink
Merge branch 'sigs' of https://github.com/kwohlfahrt/nix-serve into m…
Browse files Browse the repository at this point in the history
…aster
  • Loading branch information
edolstra committed Nov 24, 2020
2 parents bafcd01 + b888d67 commit 0b55211
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nix-serve.psgi
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ my $app = sub {
my $hashPart = $1;
my $storePath = queryPathFromHashPart($hashPart);
return [404, ['Content-Type' => 'text/plain'], ["No such path.\n"]] unless $storePath;
my ($deriver, $narHash, $time, $narSize, $refs) = queryPathInfo($storePath, 1) or die;
my ($deriver, $narHash, $time, $narSize, $refs, $sigs) = queryPathInfo($storePath, 1) or die;
my $res =
"StorePath: $storePath\n" .
"URL: nar/$hashPart.nar\n" .
Expand All @@ -42,6 +42,8 @@ my $app = sub {
my $fingerprint = fingerprintPath($storePath, $narHash, $narSize, $refs);
my $sig = signString($secretKey, $fingerprint);
$res .= "Sig: $sig\n";
} else {
$res .= join("\n", map { "Sig: $_" } @$sigs) . "\n";
}
return [200, ['Content-Type' => 'text/x-nix-narinfo'], [$res]];
}
Expand Down

0 comments on commit 0b55211

Please sign in to comment.