From a127925d9e83d66fbe6a347342e04409702a6196 Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz Date: Tue, 1 Oct 2024 15:44:32 +0200 Subject: [PATCH] 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. --- board/common/uboot/scripts/ixprepdhcp.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/board/common/uboot/scripts/ixprepdhcp.sh b/board/common/uboot/scripts/ixprepdhcp.sh index 0fe7dbca..935a1a84 100644 --- a/board/common/uboot/scripts/ixprepdhcp.sh +++ b/board/common/uboot/scripts/ixprepdhcp.sh @@ -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