Return proper 404 when path is missing
This commit is contained in:
parent
60d0005a0c
commit
187646f071
|
@ -19,6 +19,11 @@ header(){
|
||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
header404(){
|
||||||
|
echo "Status: 404 Not Found"
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
clean_path() {
|
clean_path() {
|
||||||
@gnused@/sed -re "s@^$STORE_DIR/?@@" | @findutils@/xargs
|
@gnused@/sed -re "s@^$STORE_DIR/?@@" | @findutils@/xargs
|
||||||
}
|
}
|
||||||
|
@ -72,6 +77,7 @@ case "$QUERY_STRING" in
|
||||||
echo "Signature: 1;$KEYNAME;$signature"
|
echo "Signature: 1;$KEYNAME;$signature"
|
||||||
|
|
||||||
else
|
else
|
||||||
|
header404
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
@ -81,6 +87,7 @@ case "$QUERY_STRING" in
|
||||||
header
|
header
|
||||||
@nix@/nix-store --dump "$path" | @xz@/xz
|
@nix@/nix-store --dump "$path" | @xz@/xz
|
||||||
else
|
else
|
||||||
|
header404
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
@ -91,6 +98,7 @@ case "$QUERY_STRING" in
|
||||||
header
|
header
|
||||||
@nix@/nix-store --dump "$path" | @bzip2@/bzip2
|
@nix@/nix-store --dump "$path" | @bzip2@/bzip2
|
||||||
else
|
else
|
||||||
|
header404
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in New Issue