From 12a50c9ce117b6106c92bb965799e709547d8494 Mon Sep 17 00:00:00 2001 From: Oliver Steffen Date: Tue, 22 Mar 2022 14:30:08 +0100 Subject: NetworkPkg/HttpDxe: Detect HTTP/1.0 servers 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 Reviewed-by: Maciej Rabeda Reviewed-by: Gerd Hoffmann --- NetworkPkg/HttpDxe/HttpImpl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c index 4ec2e8f667..7c5c925cf7 100644 --- a/NetworkPkg/HttpDxe/HttpImpl.c +++ b/NetworkPkg/HttpDxe/HttpImpl.c @@ -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. // -- cgit v1.2.3