Bug 1749957 - Fix parsing of content-length http3 header. r=dragana,necko-reviewers,kershaw
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 13 Jan 2022 18:04:17 +0000
changeset 604497 48c0e854be623e654f1a0814d22502ca5c618422
parent 604496 33c7f30eac1abed66cdcc624cca1e05d44c563fc
child 604498 d874ec84b50844e939bcbf4ec08f93361b79fb88
push id156006
push userealvarez@mozilla.com
push dateThu, 13 Jan 2022 18:06:40 +0000
treeherderautoland@48c0e854be62 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdragana, necko-reviewers, kershaw
bugs1749957
milestone98.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1749957 - Fix parsing of content-length http3 header. r=dragana,necko-reviewers,kershaw HTTP headers are case insensitive. Differential Revision: https://phabricator.services.mozilla.com/D135871
netwerk/protocol/http/Http3Stream.cpp
--- a/netwerk/protocol/http/Http3Stream.cpp
+++ b/netwerk/protocol/http/Http3Stream.cpp
@@ -71,17 +71,18 @@ bool Http3Stream::GetHeadersString(const
   FindRequestContentLength();
   return true;
 }
 
 void Http3Stream::FindRequestContentLength() {
   MOZ_ASSERT(OnSocketThread(), "not on socket thread");
   // Look for Content-Length header to find out if we have request body and
   // how long it is.
-  int32_t contentLengthStart = mFlatHttpRequestHeaders.Find("Content-Length:");
+  int32_t contentLengthStart =
+      mFlatHttpRequestHeaders.Find("content-length:", /* aIgnoreCase = */ true);
   if (contentLengthStart == -1) {
     // There is no content-Length.
     return;
   }
 
   // We have Content-Length header, find the end of it.
   int32_t crlfIndex =
       mFlatHttpRequestHeaders.Find("\r\n", false, contentLengthStart);