toymaker.git

commit 6c39ce8c4b85699b9031afe7a50f0ea05105b48c

Author: Adam <git@apiote.xyz>

fix parsing path in URL

 server2.sh | 3 ++-


diff --git a/server2.sh b/server2.sh
index fa22f7a46117cd972f921ac39dbb0f66ebd2a3cf..38c4d131f704eee20fa7591ed4b288c2b788ad61 100755
--- a/server2.sh
+++ b/server2.sh
@@ -156,6 +156,7 @@ 	_toys=$(field "$path" 2)
 	if [ "$_toys" != 'toys' ]
 	then
 		respond404 "$path"
+		return 1
 	fi
 
 	case $method in
@@ -184,7 +185,7 @@ 				else
 					respond406 "$accept"
 				fi
 			fi
-		elif [ "$(slashes "$path")" -eq 2 ]
+		elif [ "$(slashes "$path")" -eq 3 ]
 		then
 			toy=$(field "$path" 3)
 			item=$(field "$path" 4)