diff options
author | Oliver Steffen <osteffen@redhat.com> | 2022-03-22 14:30:08 +0100 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2022-04-11 15:12:46 +0000 |
commit | 12a50c9ce117b6106c92bb965799e709547d8494 (patch) | |
tree | 77b3b617bc8f7940985d72bfd63996dc72d0cd09 /NetworkPkg | |
parent | 753fd319e22c6d900c7c77d025bfc33976534e7f (diff) | |
download | edk2-12a50c9ce117b6106c92bb965799e709547d8494.tar.gz edk2-12a50c9ce117b6106c92bb965799e709547d8494.tar.bz2 edk2-12a50c9ce117b6106c92bb965799e709547d8494.zip |
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 <osteffen@redhat.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'NetworkPkg')
-rw-r--r-- | NetworkPkg/HttpDxe/HttpImpl.c | 8 |
1 files changed, 8 insertions, 0 deletions
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 @@ -1106,6 +1106,14 @@ HttpResponseWorker ( }
//
+ // 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.
//
StatusCodeStr = HttpHeaders + AsciiStrLen (HTTP_VERSION_STR) + 1;
|