Skip to content

Commit

Permalink
NetworkPkg/HttpDxe: Detect HTTP/1.0 servers
Browse files Browse the repository at this point in the history
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2720

Force connection close before the next request if
the server identifies as version 1.0.

Signed-off-by: Oliver Steffen <[email protected]>
Reviewed-by: Maciej Rabeda <[email protected]>
Reviewed-by: Gerd Hoffmann <[email protected]>
  • Loading branch information
osteffenrh authored and mergify[bot] committed Apr 11, 2022
1 parent 753fd31 commit 12a50c9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions NetworkPkg/HttpDxe/HttpImpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,14 @@ HttpResponseWorker (
HttpInstance->CacheLen = BodyLen;
}

//
// Check server's HTTP version.
//
if (AsciiStrnCmp (HttpHeaders, "HTTP/1.0", sizeof ("HTTP/1.0") - 1) == 0) {
DEBUG ((DEBUG_VERBOSE, "HTTP: Server version is 1.0. Setting Connection close.\n"));
HttpInstance->ConnectionClose = TRUE;
}

//
// Search for Status Code.
//
Expand Down

0 comments on commit 12a50c9

Please sign in to comment.