Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RedfishClientPkg/RedfishFeatureUtilityLib: accept 201 HTTP status code #91

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1777,7 +1777,9 @@ GetHttpResponseEtag (
DEBUG ((DEBUG_INFO, "%a: WARNING - No ETag support on Redfish service.\n", __func__));
return EFI_UNSUPPORTED;
} else {
if (*(Response->StatusCode) == HTTP_STATUS_200_OK) {
if ((*(Response->StatusCode) == HTTP_STATUS_200_OK) ||
(*(Response->StatusCode) == HTTP_STATUS_201_CREATED))
{
Header = HttpFindHeader (Response->HeaderCount, Response->Headers, HTTP_HEADER_ETAG);
if (Header != NULL) {
*Etag = AllocateCopyPool (AsciiStrSize (Header->FieldValue), Header->FieldValue);
Expand Down Expand Up @@ -1806,7 +1808,7 @@ GetHttpResponseEtag (

if (*Etag == NULL) {
Status = EFI_NOT_FOUND;
DEBUG ((DEBUG_ERROR, "%a: Failed to retrieve ETag from HTTP response paylaod.\n", __func__));
DEBUG ((DEBUG_ERROR, "%a: Failed to retrieve ETag from HTTP response payload.\n", __func__));
}
}

Expand Down Expand Up @@ -1841,7 +1843,9 @@ GetHttpResponseLocation (
Status = EFI_SUCCESS;
*Location = NULL;
AsciiLocation = NULL;
if (*(Response->StatusCode) == HTTP_STATUS_200_OK) {
if ((*(Response->StatusCode) == HTTP_STATUS_200_OK) ||
(*(Response->StatusCode) == HTTP_STATUS_201_CREATED))
{
Header = HttpFindHeader (Response->HeaderCount, Response->Headers, HTTP_HEADER_LOCATION);
if (Header != NULL) {
AsciiLocation = AllocateCopyPool (AsciiStrSize (Header->FieldValue), Header->FieldValue);
Expand Down Expand Up @@ -1873,7 +1877,7 @@ GetHttpResponseLocation (
FreePool (AsciiLocation);
} else {
Status = EFI_NOT_FOUND;
DEBUG ((DEBUG_ERROR, "%a: Failed to retrieve Location from HTTP response paylaod.\n", __func__));
DEBUG ((DEBUG_ERROR, "%a: Failed to retrieve Location from HTTP response payload.\n", __func__));
}

return Status;
Expand Down
Loading