support urlencoded names

This commit is contained in:
numzero 2026-05-03 00:19:50 +03:00
parent e6f049da4b
commit 7d051690f5

View File

@ -44,6 +44,7 @@ handle() {
if ! [ "$method" = "GET" ]; then if ! [ "$method" = "GET" ]; then
error 501 'Not Implemented' "Method $method is not implemented.${LF}Only GET is supported." error 501 'Not Implemented' "Method $method is not implemented.${LF}Only GET is supported."
fi fi
url="$(echo "$url" | urlencode -d)"
if ! echo "$url" | grep -q '^/'; then if ! echo "$url" | grep -q '^/'; then
error 400 'Bad Request' "URL must be host-relative" error 400 'Bad Request' "URL must be host-relative"
fi fi