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

Unified Diff: net/spdy/spdy_network_transaction_unittest.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/spdy/header_coalescer_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_network_transaction_unittest.cc
diff --git a/net/spdy/spdy_network_transaction_unittest.cc b/net/spdy/spdy_network_transaction_unittest.cc
index bd229f9a850aa847849b1197accb8033d1923183..9dd20a3b3d604d9cb279d02c447f6c6370733198 100644
--- a/net/spdy/spdy_network_transaction_unittest.cc
+++ b/net/spdy/spdy_network_transaction_unittest.cc
@@ -6206,6 +6206,29 @@ TEST_F(SpdyNetworkTransactionTest, LargeResponseHeader) {
ASSERT_TRUE(out.response_info.headers->HasHeaderValue(kKey, kValue));
}
+// End of line delimiter is forbidden according to RFC 7230 Section 3.2.
+TEST_F(SpdyNetworkTransactionTest, CRLFInHeaderValue) {
+ SpdySerializedFrame req(
+ spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, true));
+ SpdySerializedFrame rst(
+ spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_PROTOCOL_ERROR));
+ MockWrite writes[] = {CreateMockWrite(req, 0), CreateMockWrite(rst, 2)};
+
+ const char* response_headers[] = {"folded", "foo\r\nbar"};
+ SpdySerializedFrame resp(
+ spdy_util_.ConstructSpdyGetReply(response_headers, 1, 1));
+ MockRead reads[] = {CreateMockRead(resp, 1), MockRead(ASYNC, 0, 3)};
+
+ SequencedSocketData data(reads, arraysize(reads), writes, arraysize(writes));
+
+ NormalSpdyTransactionHelper helper(CreateGetRequest(), DEFAULT_PRIORITY,
+ BoundNetLog(), nullptr);
+ helper.RunToCompletion(&data);
+ TransactionHelperResult out = helper.output();
+
+ EXPECT_THAT(out.rv, IsError(ERR_SPDY_PROTOCOL_ERROR));
+}
+
class SpdyNetworkTransactionTLSUsageCheckTest
: public SpdyNetworkTransactionTest {
protected:
« no previous file with comments | « net/spdy/header_coalescer_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698