summaryrefslogtreecommitdiffstats
path: root/NetworkPkg
diff options
context:
space:
mode:
authorJiaxin Wu <jiaxin.wu@intel.com>2017-02-15 14:32:14 +0800
committerJiaxin Wu <jiaxin.wu@intel.com>2017-02-16 22:35:19 +0800
commitb173ad78519b2ade309019614b52e1453727e20d (patch)
tree59ca526400290ee2d7c88e8dd2c03b7e3a0d57c5 /NetworkPkg
parent6c6452c6e23a89be0e565501500e83c136e3fcbd (diff)
downloadedk2-b173ad78519b2ade309019614b52e1453727e20d.tar.gz
edk2-b173ad78519b2ade309019614b52e1453727e20d.tar.bz2
edk2-b173ad78519b2ade309019614b52e1453727e20d.zip
NetworkPkg/HttpBootDxe: Update to check specified media type
IANA has approved below new media type for EFI http(s) boot usage: application/vnd.efi.img application/vnd.efi.iso HTTP boot driver should be updated to check the above media type from Content-Type header field. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
Diffstat (limited to 'NetworkPkg')
-rw-r--r--NetworkPkg/HttpBootDxe/HttpBootDxe.h6
-rw-r--r--NetworkPkg/HttpBootDxe/HttpBootSupport.c10
2 files changed, 13 insertions, 3 deletions
diff --git a/NetworkPkg/HttpBootDxe/HttpBootDxe.h b/NetworkPkg/HttpBootDxe/HttpBootDxe.h
index 28145949fe..a1e6792514 100644
--- a/NetworkPkg/HttpBootDxe/HttpBootDxe.h
+++ b/NetworkPkg/HttpBootDxe/HttpBootDxe.h
@@ -74,10 +74,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define HTTP_BOOT_DXE_VERSION 0xa
//
-// Provisional Standard Media Types defined in
-// http://www.iana.org/assignments/provisional-standard-media-types/provisional-standard-media-types.xhtml
+// Standard Media Types defined in
+// http://www.iana.org/assignments/media-types
//
#define HTTP_CONTENT_TYPE_APP_EFI "application/efi"
+#define HTTP_CONTENT_TYPE_APP_IMG "application/vnd.efi-img"
+#define HTTP_CONTENT_TYPE_APP_ISO "application/vnd.efi-iso"
//
// Protocol instances
diff --git a/NetworkPkg/HttpBootDxe/HttpBootSupport.c b/NetworkPkg/HttpBootDxe/HttpBootSupport.c
index e831df92a5..56c4c15836 100644
--- a/NetworkPkg/HttpBootDxe/HttpBootSupport.c
+++ b/NetworkPkg/HttpBootDxe/HttpBootSupport.c
@@ -1178,13 +1178,21 @@ HttpBootCheckImageType (
//
// Determine the image type by the HTTP Content-Type header field first.
- // "application/efi" -> EFI Image
+ // "application/efi" -> EFI Image
+ // "application/vnd.efi-iso" -> CD/DVD Image
+ // "application/vnd.efi-img" -> Virtual Disk Image
//
Header = HttpFindHeader (HeaderCount, Headers, HTTP_HEADER_CONTENT_TYPE);
if (Header != NULL) {
if (AsciiStriCmp (Header->FieldValue, HTTP_CONTENT_TYPE_APP_EFI) == 0) {
*ImageType = ImageTypeEfi;
return EFI_SUCCESS;
+ } else if (AsciiStriCmp (Header->FieldValue, HTTP_CONTENT_TYPE_APP_ISO) == 0) {
+ *ImageType = ImageTypeVirtualCd;
+ return EFI_SUCCESS;
+ } else if (AsciiStriCmp (Header->FieldValue, HTTP_CONTENT_TYPE_APP_IMG) == 0) {
+ *ImageType = ImageTypeVirtualDisk;
+ return EFI_SUCCESS;
}
}