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

Unified Diff: net/spdy/hpack_decoder.h

Issue 531253004: HPACK: Check pseudo-header order in decoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update examples_07.hpack. Created 6 years, 3 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/data/spdy_tests/examples_07.hpack ('k') | net/spdy/hpack_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/hpack_decoder.h
diff --git a/net/spdy/hpack_decoder.h b/net/spdy/hpack_decoder.h
index 7a27615a914d1626ea3131ba7dfd105dcbff7e0a..a97405836576d458a21c3434dec24d9c6d8ca50c 100644
--- a/net/spdy/hpack_decoder.h
+++ b/net/spdy/hpack_decoder.h
@@ -77,9 +77,13 @@ class NET_EXPORT_PRIVATE HpackDecoder {
// Note that this may be too accomodating, as the sender's HTTP2 layer
// should have already joined and delimited these values.
//
+ // Returns false if a pseudo-header field follows a regular header one, which
+ // MUST be treated as malformed, as per sections 8.1.2.1. of the HTTP2 draft
+ // specification.
+ //
// TODO(jgraettinger): This method will eventually emit to the
// SpdyHeadersHandlerInterface visitor.
- void HandleHeaderRepresentation(base::StringPiece name,
+ bool HandleHeaderRepresentation(base::StringPiece name,
base::StringPiece value);
const uint32 max_string_literal_size_;
@@ -94,6 +98,9 @@ class NET_EXPORT_PRIVATE HpackDecoder {
std::string headers_block_buffer_;
std::map<std::string, std::string> decoded_block_;
+ // Flag to keep track of having seen a regular header field.
+ bool regular_header_seen_;
+
// Huffman table to be applied to decoded Huffman literals,
// and scratch space for storing those decoded literals.
const HpackHuffmanTable& huffman_table_;
« no previous file with comments | « net/data/spdy_tests/examples_07.hpack ('k') | net/spdy/hpack_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698