Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Issue 2710053002: HTTP/2 Check header names in HeaderCoalescer (Closed)

Created:
3 years, 10 months ago by xunjieli
Modified:
3 years, 9 months ago
Reviewers:
asanka, Bence, Biren Roy
CC:
chromium-reviews, cbentzel+watch_chromium.org, bnc+watch_chromium.org, net-reviews_chromium.org, Maks Orlovich
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

HTTP/2 Check header names in HeaderCoalescer According to RFC 7540 Section 8.1.2, HTTP/2 header names are ASCII characters. SpdyStream::SaveResponseHeaders() checks whether header names contain uppercase ASCII characters, but not whether header names are valid tokens. This CL makes HeaderCoalescer to enforce an header name validity check by HttpUtil::IsValidHeaderName(). BUG=691243 Review-Url: https://codereview.chromium.org/2710053002 Cr-Commit-Position: refs/heads/master@{#453749} Committed: https://chromium.googlesource.com/chromium/src/+/21b64f4da725d81384c3558f96d9d8b045c99633

Patch Set 1 #

Total comments: 2

Patch Set 2 : use asanka's suggestion #

Total comments: 4

Patch Set 3 : fix pseudo and add test #

Total comments: 6

Patch Set 4 : add tests #

Total comments: 17

Patch Set 5 : fix tests and address comments #

Patch Set 6 : minor optimization #

Unified diffs Side-by-side diffs Delta from patch set Stats (+77 lines, -8 lines) Patch
M net/spdy/header_coalescer.cc View 1 2 3 4 5 2 chunks +16 lines, -8 lines 0 comments Download
M net/spdy/header_coalescer_test.cc View 1 2 3 4 2 chunks +61 lines, -0 lines 0 comments Download

Messages

Total messages: 51 (27 generated)
xunjieli
Bence and Biren: Is this the right way to solve the issue (crbug.com/691243)? I can't ...
3 years, 10 months ago (2017-02-22 19:03:59 UTC) #2
Biren Roy
On 2017/02/22 19:03:59, xunjieli wrote: > Bence and Biren: Is this the right way to ...
3 years, 10 months ago (2017-02-22 19:11:16 UTC) #5
asanka
https://codereview.chromium.org/2710053002/diff/1/net/spdy/header_coalescer.cc File net/spdy/header_coalescer.cc (right): https://codereview.chromium.org/2710053002/diff/1/net/spdy/header_coalescer.cc#newcode28 net/spdy/header_coalescer.cc:28: if (!base::IsStringASCII(key)) { Consider using something like HttpUtil::IsValidHeaderName(). RFC ...
3 years, 10 months ago (2017-02-22 19:44:13 UTC) #6
xunjieli
Done. PTAL. https://codereview.chromium.org/2710053002/diff/1/net/spdy/header_coalescer.cc File net/spdy/header_coalescer.cc (right): https://codereview.chromium.org/2710053002/diff/1/net/spdy/header_coalescer.cc#newcode28 net/spdy/header_coalescer.cc:28: if (!base::IsStringASCII(key)) { On 2017/02/22 19:44:13, asanka ...
3 years, 10 months ago (2017-02-22 20:14:51 UTC) #10
Biren Roy
lgtm https://codereview.chromium.org/2710053002/diff/20001/net/spdy/header_coalescer.cc File net/spdy/header_coalescer.cc (right): https://codereview.chromium.org/2710053002/diff/20001/net/spdy/header_coalescer.cc#newcode40 net/spdy/header_coalescer.cc:40: if (key[0] == ':') { This code block ...
3 years, 10 months ago (2017-02-22 20:26:23 UTC) #11
asanka
Let's add a couple of tests for this. Also why are we deferring the lowercase ...
3 years, 10 months ago (2017-02-22 20:29:37 UTC) #13
xunjieli
https://codereview.chromium.org/2710053002/diff/20001/net/spdy/header_coalescer.cc File net/spdy/header_coalescer.cc (right): https://codereview.chromium.org/2710053002/diff/20001/net/spdy/header_coalescer.cc#newcode40 net/spdy/header_coalescer.cc:40: if (key[0] == ':') { On 2017/02/22 20:26:23, Biren ...
3 years, 10 months ago (2017-02-22 22:19:59 UTC) #14
Biren Roy
https://codereview.chromium.org/2710053002/diff/20001/net/spdy/header_coalescer.cc File net/spdy/header_coalescer.cc (right): https://codereview.chromium.org/2710053002/diff/20001/net/spdy/header_coalescer.cc#newcode40 net/spdy/header_coalescer.cc:40: if (key[0] == ':') { On 2017/02/22 22:19:58, xunjieli ...
3 years, 10 months ago (2017-02-22 22:34:20 UTC) #15
Bence
xunjieli, thank you for fixing this. birenroy and asanka, thank you for the reviews. +1 ...
3 years, 10 months ago (2017-02-22 23:42:21 UTC) #16
xunjieli
> +1 to adding tests. Done. > +1 to moving lowercase enforcement from SpdyStream::SaveResponseHeaders() to ...
3 years, 10 months ago (2017-02-23 16:10:42 UTC) #17
Biren Roy
lgtm
3 years, 10 months ago (2017-02-23 16:54:34 UTC) #20
asanka
https://codereview.chromium.org/2710053002/diff/40001/net/spdy/header_coalescer.cc File net/spdy/header_coalescer.cc (right): https://codereview.chromium.org/2710053002/diff/40001/net/spdy/header_coalescer.cc#newcode53 net/spdy/header_coalescer.cc:53: if (value.find("\r\n") != base::StringPiece::npos) { HttpUtil::IsValidHeaderValue(value) According to RFC ...
3 years, 10 months ago (2017-02-23 17:45:16 UTC) #23
Bence
On 2017/02/23 16:10:42, xunjieli wrote: > > > Note that HttpUtil::IsValidHeaderName() is okay with colons, ...
3 years, 10 months ago (2017-02-23 23:06:16 UTC) #24
xunjieli
Thanks Asanka for walking me through the spec. Asanka + Bence : PTAL. https://codereview.chromium.org/2710053002/diff/40001/net/spdy/header_coalescer.cc File ...
3 years, 10 months ago (2017-02-23 23:07:38 UTC) #25
asanka
https://codereview.chromium.org/2710053002/diff/60001/net/spdy/header_coalescer.cc File net/spdy/header_coalescer.cc (right): https://codereview.chromium.org/2710053002/diff/60001/net/spdy/header_coalescer.cc#newcode52 net/spdy/header_coalescer.cc:52: // Line folding, RFC 7230 Section 3.2.4., is a ...
3 years, 10 months ago (2017-02-23 23:18:54 UTC) #28
Bence
LGTM modulo asanka's and my nits. https://codereview.chromium.org/2710053002/diff/60001/net/spdy/header_coalescer_test.cc File net/spdy/header_coalescer_test.cc (right): https://codereview.chromium.org/2710053002/diff/60001/net/spdy/header_coalescer_test.cc#newcode9 net/spdy/header_coalescer_test.cc:9: #include "base/strings/string_piece.h" In ...
3 years, 10 months ago (2017-02-23 23:33:04 UTC) #29
xunjieli
I filed a follow-up bug on moving ascii check from SpdyStream to HeaderCoalescer at crbug.com/695495 ...
3 years, 9 months ago (2017-02-24 16:33:33 UTC) #34
xunjieli
https://codereview.chromium.org/2710053002/diff/60001/net/spdy/header_coalescer.cc File net/spdy/header_coalescer.cc (right): https://codereview.chromium.org/2710053002/diff/60001/net/spdy/header_coalescer.cc#newcode52 net/spdy/header_coalescer.cc:52: // Line folding, RFC 7230 Section 3.2.4., is a ...
3 years, 9 months ago (2017-02-24 16:35:33 UTC) #35
Bence
https://codereview.chromium.org/2710053002/diff/60001/net/spdy/header_coalescer.cc File net/spdy/header_coalescer.cc (right): https://codereview.chromium.org/2710053002/diff/60001/net/spdy/header_coalescer.cc#newcode52 net/spdy/header_coalescer.cc:52: // Line folding, RFC 7230 Section 3.2.4., is a ...
3 years, 9 months ago (2017-02-24 16:51:30 UTC) #36
xunjieli
https://codereview.chromium.org/2710053002/diff/60001/net/spdy/header_coalescer_test.cc File net/spdy/header_coalescer_test.cc (right): https://codereview.chromium.org/2710053002/diff/60001/net/spdy/header_coalescer_test.cc#newcode9 net/spdy/header_coalescer_test.cc:9: #include "base/strings/string_piece.h" On 2017/02/24 16:51:30, Bence wrote: > On ...
3 years, 9 months ago (2017-02-24 17:36:55 UTC) #37
Bence
LGTM. https://codereview.chromium.org/2710053002/diff/60001/net/spdy/header_coalescer_test.cc File net/spdy/header_coalescer_test.cc (right): https://codereview.chromium.org/2710053002/diff/60001/net/spdy/header_coalescer_test.cc#newcode9 net/spdy/header_coalescer_test.cc:9: #include "base/strings/string_piece.h" On 2017/02/24 17:36:55, xunjieli wrote: > ...
3 years, 9 months ago (2017-02-24 18:48:29 UTC) #42
asanka
LGTM thanks!
3 years, 9 months ago (2017-02-28 20:43:55 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2710053002/100001
3 years, 9 months ago (2017-02-28 20:50:24 UTC) #48
commit-bot: I haz the power
3 years, 9 months ago (2017-02-28 23:50:13 UTC) #51
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as
https://chromium.googlesource.com/chromium/src/+/21b64f4da725d81384c3558f96d9...

Powered by Google App Engine
This is Rietveld 408576698