Return proper 404 when path is missing

This commit is contained in:
Michael Raskin 2015-01-03 16:55:56 +03:00
parent 60d0005a0c
commit 187646f071

View file

@ -19,6 +19,11 @@ header(){
echo
}
header404(){
echo "Status: 404 Not Found"
echo
}
clean_path() {
@gnused@/sed -re "s@^$STORE_DIR/?@@" | @findutils@/xargs
}
@ -72,6 +77,7 @@ case "$QUERY_STRING" in
echo "Signature: 1;$KEYNAME;$signature"
else
header404
exit 1
fi
;;
@ -81,6 +87,7 @@ case "$QUERY_STRING" in
header
@nix@/nix-store --dump "$path" | @xz@/xz
else
header404
exit 1
fi
;;
@ -91,6 +98,7 @@ case "$QUERY_STRING" in
header
@nix@/nix-store --dump "$path" | @bzip2@/bzip2
else
header404
exit 1
fi
;;