From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web12.9771.1647955842053401887 for ; Tue, 22 Mar 2022 06:30:42 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iBoEtjhh; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: osteffen@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647955841; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YJXX2Dr96ZWuVjf3WDwiPYqo0C7P0istj+6qEuT5s2s=; b=iBoEtjhh2Sa8EstR05FCzZTMYIF/roZRY9KyboTFv96GFWz9gaEt5m9TOtVoUKFKnF0UE+ vpuENg36rblS3Md7xGd/aV5CDIFLbPPi9a1A7h9za8ACAh/wdUgdq1qjCWPKVczXkiw/mx 3VfTIRBd+/O0oLGb5ndqK/tDEI6CGq8= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-575-xY2r7-yePPO758DYQsjpRg-1; Tue, 22 Mar 2022 09:30:37 -0400 X-MC-Unique: xY2r7-yePPO758DYQsjpRg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 592A92A2AD63; Tue, 22 Mar 2022 13:30:37 +0000 (UTC) Received: from osteffen-laptop.fritz.box (unknown [10.39.195.249]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1681D400E875; Tue, 22 Mar 2022 13:30:35 +0000 (UTC) From: "Oliver Steffen" To: devel@edk2.groups.io Cc: maciej.rabeda@linux.intel.com, jiaxin.wu@intel.com, siyuan.fu@intel.com, kraxel@redhat.com, Oliver Steffen Subject: [PATCH v3 5/5] NetworkPkg/HttpDxe: Detect HTTP/1.0 servers Date: Tue, 22 Mar 2022 14:30:08 +0100 Message-Id: <20220322133008.152037-6-osteffen@redhat.com> In-Reply-To: <20220322133008.152037-1-osteffen@redhat.com> References: <20220304130403.47832-1-osteffen@redhat.com> <20220322133008.152037-1-osteffen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=osteffen@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" 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 --- NetworkPkg/HttpDxe/HttpImpl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c index d40d55ac92ad..623e029c606e 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", AsciiStrLen ("HTTP/1.0")) == 0) { + DEBUG ((DEBUG_VERBOSE, "HTTP: Server version is 1.0. Setting Connection close.\n")); + HttpInstance->ConnectionClose = TRUE; + } + // // Search for Status Code. // -- 2.35.1