* Escape +', =' and `?' in NAR URIS in manifests. Otherwise you get

an incorrect URI that gives a 410 error.
This commit is contained in:
Eelco Dolstra 2010-02-09 16:11:35 +00:00
parent 6dd53655a5
commit a7d132ff2a

View file

@ -22,8 +22,15 @@ sub process {
foreach my $path (@paths) {
my ($hash, $deriver, $refs) = queryPathInfo $path;
# Escape the characters that are allowed to appear in a Nix
# path name but have special meaning in a URI.
my $escaped = $path;
$escaped =~ s/\+/%2b/g;
$escaped =~ s/\=/%3d/g;
$escaped =~ s/\?/%3f/g;
my $url = $c->stash->{narBase} . $path;
my $url = $c->stash->{narBase} . $escaped;
$manifest .=
"{\n" .