summaryrefslogtreecommitdiff
path: root/NetworkPkg
diff options
context:
space:
mode:
Diffstat (limited to 'NetworkPkg')
-rw-r--r--NetworkPkg/HttpDxe/HttpImpl.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c
index 545fe42..80e8192 100644
--- a/NetworkPkg/HttpDxe/HttpImpl.c
+++ b/NetworkPkg/HttpDxe/HttpImpl.c
@@ -227,7 +227,8 @@ 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,25 @@ EfiHttpRequest (
//
// Create request message.
//
- RequestStr = HttpGenRequestString (HttpInstance, HttpMsg, Url);
+ FileUrl = Url;
+ if (*FileUrl != '/') {
+ //
+ // Convert the absolute-URI to the absolute-path
+ //
+ 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;