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>
This commit is contained in:
Jiaxin Wu
2017-02-15 14:32:14 +08:00
parent 6c6452c6e2
commit b173ad7851
2 changed files with 13 additions and 3 deletions

View File

@@ -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;
}
}