uboot: Add leading slash to path when using HTTP

RFC 7230, section 5.3.1 specifies that the path must start with a
slash.

...and nginx is not amused by its absence.
This commit is contained in:
Tobias Waldekranz
2024-10-01 16:00:38 +02:00
parent 69b93507a9
commit a127925d9e
+4 -1
View File
@@ -4,9 +4,12 @@ if test -n "${ipaddr}" -a -n "${netmask}" -a -n "${serverip}" -a -n "${bootfile}
setenv proto tftp
setenv dltool tftpboot
if setexpr proto sub "^(http|tftp)://.*" "\\1" "${bootfile}" && setexpr bootfile sub "^(http|tftp)://([^/]+?)/(.*)" "\2:\3"; then
if setexpr proto sub "^(http|tftp)://.*" "\\1" "${bootfile}"; then
if test "${proto}" = "http"; then
setenv dltool wget
setexpr bootfile sub "^http://([^/]+?)/(.*)" "\1:/\2"
else
setexpr bootfile sub "^tftp://([^/]+?)/(.*)" "\1:\2"
fi
fi