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

Unified Diff: net/spdy/header_coalescer.cc

Issue 2184253002: Reset HTTP/2 stream on line-folded response headers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re: #7. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/net.gypi ('k') | net/spdy/header_coalescer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/header_coalescer.cc
diff --git a/net/spdy/header_coalescer.cc b/net/spdy/header_coalescer.cc
index 1c88fbab6a36a778c4b46e9ae115a583a8849aee..199fabf445cf8b9b239e223c1e054810f0b5e8fc 100644
--- a/net/spdy/header_coalescer.cc
+++ b/net/spdy/header_coalescer.cc
@@ -39,6 +39,13 @@ void HeaderCoalescer::OnHeader(base::StringPiece key, base::StringPiece value) {
regular_header_seen_ = true;
}
+ // End of line delimiter is forbidden according to RFC 7230 Section 3.2.
+ // Line folding, RFC 7230 Section 3.2.4., is a special case of this.
+ if (value.find("\r\n") != base::StringPiece::npos) {
+ error_seen_ = true;
+ return;
+ }
+
auto iter = headers_.find(key);
if (iter == headers_.end()) {
headers_[key] = value;
« no previous file with comments | « net/net.gypi ('k') | net/spdy/header_coalescer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698