I checked RFC7230 and agreed we need use the origin-form of URI instead of using absolute-form. Thanks for fixing this.
Reviewed-by: Ye Ting <[email protected]> -----Original Message----- From: edk2-devel [mailto:[email protected]] On Behalf Of Gary Ching-Pang Lin Sent: Friday, August 14, 2015 5:04 PM To: [email protected] Cc: Justen, Jordan L; Fu, Siyuan; Laszlo Ersek Subject: [edk2] [PATCH 1/2] NetworkPkg: Remove the hostname for the http request url The hostname is already set in the header of the http request. The url shouldn't contain the hostname since the hostname will be prepended to the url when the server interprets the request. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gary Ching-Pang Lin <[email protected]> --- NetworkPkg/HttpDxe/HttpImpl.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c index 545fe42..030dcfe 100644 --- a/NetworkPkg/HttpDxe/HttpImpl.c +++ b/NetworkPkg/HttpDxe/HttpImpl.c @@ -227,6 +227,7 @@ EfiHttpRequest ( CHAR16 *HostNameStr; HTTP_TOKEN_WRAP *Wrap; HTTP_TCP_TOKEN_WRAP *TcpWrap; + CHAR8 *FileUrl; if ((This == NULL) || (Token == NULL)) { return EFI_INVALID_PARAMETER; @@ -450,7 +451,18 @@ EfiHttpRequest ( // // Create request message. // - RequestStr = HttpGenRequestString (HttpInstance, HttpMsg, Url); + FileUrl = Url; + while (*FileUrl != ':') + FileUrl++; + if ((*(FileUrl+1) == '/') && (*(FileUrl+2) == '/')) { + FileUrl += 3; + while (*FileUrl != '/') + FileUrl++; + } else { + Status = EFI_INVALID_PARAMETER; + goto Error3; + } + RequestStr = HttpGenRequestString (HttpInstance, HttpMsg, FileUrl); if (RequestStr == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Error3; -- 2.1.4 _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

