]> xenbits.xensource.com Git - people/aperard/ovmf.git/commitdiff
NetworkPkg: DxeHttpLib: Use HTTP error 429
authorKen Lautner <kenlautner3@gmail.com>
Wed, 28 Aug 2024 18:17:22 +0000 (11:17 -0700)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 2 Sep 2024 21:17:25 +0000 (21:17 +0000)
Include a mapping for HTTP error 429 to return the correct
status code. Additionally include a link to the official
HTTP status codes in the HttpMappingToStatusCode function header.

Signed-off-by: Kenneth Lautner <kenlautner3@gmail.com>
NetworkPkg/Include/Library/HttpLib.h
NetworkPkg/Library/DxeHttpLib/DxeHttpLib.c

index f8505ab4d7ea13603975bfb23131cc1184f2d8dc..a6894d3fe3732ed8f6d1e5744f9e6db92b5d1581 100644 (file)
@@ -444,6 +444,9 @@ HttpGenRequestMessage (
   Translate the status code in HTTP message to EFI_HTTP_STATUS_CODE defined\r
   in UEFI 2.5 specification.\r
 \r
+  The official HTTP status codes can be found here:\r
+  https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml\r
+\r
   @param[in]  StatusCode         The status code value in HTTP message.\r
 \r
   @return                        Value defined in EFI_HTTP_STATUS_CODE .\r
index f1da69bbf795a058d6115b63e2353cc06415b923..edb8f580fae9d11d3a487bd9f2ab6888e45161cf 100644 (file)
@@ -1995,6 +1995,9 @@ Exit:
   Translate the status code in HTTP message to EFI_HTTP_STATUS_CODE defined\r
   in UEFI 2.5 specification.\r
 \r
+  The official HTTP status codes can be found here:\r
+  https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml\r
+\r
   @param[in]  StatusCode         The status code value in HTTP message.\r
 \r
   @return                        Value defined in EFI_HTTP_STATUS_CODE .\r
@@ -2077,6 +2080,8 @@ HttpMappingToStatusCode (
       return HTTP_STATUS_416_REQUESTED_RANGE_NOT_SATISFIED;\r
     case 417:\r
       return HTTP_STATUS_417_EXPECTATION_FAILED;\r
+    case 429:\r
+      return HTTP_STATUS_429_TOO_MANY_REQUESTS;\r
     case 500:\r
       return HTTP_STATUS_500_INTERNAL_SERVER_ERROR;\r
     case 501:\r