diff options
author | Ken Lautner <kenlautner3@gmail.com> | 2024-08-28 11:17:22 -0700 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-09-02 21:17:25 +0000 |
commit | 82c5cacd134d64ea0d0f4dabdbbde38017acb70d (patch) | |
tree | 02dade0b4a789305039df409e36249180f0143e8 /NetworkPkg | |
parent | 829f773e5c512fe69db153e565213740e4d15394 (diff) | |
download | edk2-82c5cacd134d64ea0d0f4dabdbbde38017acb70d.tar.gz edk2-82c5cacd134d64ea0d0f4dabdbbde38017acb70d.tar.bz2 edk2-82c5cacd134d64ea0d0f4dabdbbde38017acb70d.zip |
NetworkPkg: DxeHttpLib: Use HTTP error 429
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>
Diffstat (limited to 'NetworkPkg')
-rw-r--r-- | NetworkPkg/Include/Library/HttpLib.h | 3 | ||||
-rw-r--r-- | NetworkPkg/Library/DxeHttpLib/DxeHttpLib.c | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/NetworkPkg/Include/Library/HttpLib.h b/NetworkPkg/Include/Library/HttpLib.h index f8505ab4d7..a6894d3fe3 100644 --- a/NetworkPkg/Include/Library/HttpLib.h +++ b/NetworkPkg/Include/Library/HttpLib.h @@ -444,6 +444,9 @@ HttpGenRequestMessage ( Translate the status code in HTTP message to EFI_HTTP_STATUS_CODE defined
in UEFI 2.5 specification.
+ The official HTTP status codes can be found here:
+ https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
+
@param[in] StatusCode The status code value in HTTP message.
@return Value defined in EFI_HTTP_STATUS_CODE .
diff --git a/NetworkPkg/Library/DxeHttpLib/DxeHttpLib.c b/NetworkPkg/Library/DxeHttpLib/DxeHttpLib.c index f1da69bbf7..edb8f580fa 100644 --- a/NetworkPkg/Library/DxeHttpLib/DxeHttpLib.c +++ b/NetworkPkg/Library/DxeHttpLib/DxeHttpLib.c @@ -1995,6 +1995,9 @@ Exit: Translate the status code in HTTP message to EFI_HTTP_STATUS_CODE defined
in UEFI 2.5 specification.
+ The official HTTP status codes can be found here:
+ https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
+
@param[in] StatusCode The status code value in HTTP message.
@return Value defined in EFI_HTTP_STATUS_CODE .
@@ -2077,6 +2080,8 @@ HttpMappingToStatusCode ( return HTTP_STATUS_416_REQUESTED_RANGE_NOT_SATISFIED;
case 417:
return HTTP_STATUS_417_EXPECTATION_FAILED;
+ case 429:
+ return HTTP_STATUS_429_TOO_MANY_REQUESTS;
case 500:
return HTTP_STATUS_500_INTERNAL_SERVER_ERROR;
case 501:
|