toymaker.git

commit c3392bf941d4a5b47e6741bfa031922f77bb2072

Author: Adam <git@apiote.xyz>

fix return 404 in /toys/$toy/

 server2.sh | 5 +++++


diff --git a/server2.sh b/server2.sh
index 0505319612403e0ec2de055d015a64bfe95ba182..ad646f5371ce9db4eac1b6f5fdafc1ea7de562ef 100755
--- a/server2.sh
+++ b/server2.sh
@@ -212,6 +212,11 @@ 		elif [ "$(slashes "$path")" -eq 3 ]
 		then
 			toy=$(field "$path" 3)
 			item=$(field "$path" 4)
+			if [ -z "$item" ]
+			then
+				respond404 "$path"
+				return 1
+			fi
 			r=$(show_item "$toy" "$item")
 			status=$(echo "$r" | cut -d ';' -f 1)
 			if [ "$status" = 'n' ]