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

Unified Diff: net/quic/quic_client_promised_info.cc

Issue 1692253004: QUIC - chromium server push support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initial for-review version Created 4 years, 10 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
Index: net/quic/quic_client_promised_info.cc
diff --git a/net/quic/quic_client_promised_info.cc b/net/quic/quic_client_promised_info.cc
index 1c2aa143e796f27a1bb27d5214399a8713474cb3..3b8740c48e2fdf9b05bb1af975ac03a532b63abd 100644
--- a/net/quic/quic_client_promised_info.cc
+++ b/net/quic/quic_client_promised_info.cc
@@ -37,6 +37,16 @@ void QuicClientPromisedInfo::Init() {
}
void QuicClientPromisedInfo::OnPromiseHeaders(const SpdyHeaderBlock& headers) {
+ // RFC7540, Section 8.2, requests MUST be safe [RFC7231], Section
+ // 4.2.1. GET and HEAD are the methods that are safe and required.
+ SpdyHeaderBlock::const_iterator it = headers.find(":method");
+ DCHECK(it != headers.end());
+ if (!(it->second == "GET" || it->second == "HEAD")) {
+ DVLOG(1) << "Promise for stream " << id_ << " has invalid method "
+ << it->second;
+ Reset(QUIC_INVALID_PROMISE_METHOD);
+ return;
+ }
if (!SpdyUtils::UrlIsValid(headers)) {
DVLOG(1) << "Promise for stream " << id_ << " has invalid URL " << url_;
Reset(QUIC_INVALID_PROMISE_URL);

Powered by Google App Engine
This is Rietveld 408576698