Index: net/spdy/spdy_alt_svc_wire_format.cc |
diff --git a/net/spdy/spdy_alt_svc_wire_format.cc b/net/spdy/spdy_alt_svc_wire_format.cc |
index a418cd73e2df91c7bf7188ad529de882f2aebc1f..c8f26afaf3ac4f4058062aebfa9852aac426d5f5 100644 |
--- a/net/spdy/spdy_alt_svc_wire_format.cc |
+++ b/net/spdy/spdy_alt_svc_wire_format.cc |
@@ -119,7 +119,11 @@ bool SpdyAltSvcWireFormat::ParseHeaderFieldValue( |
return false; |
} |
} else if (parameter_name.compare("p") == 0) { |
- if (!ParseProbability(parameter_value_begin, c, &p)) { |
+ // Probability value is enclosed in quotation marks. |
+ if (*parameter_value_begin != '"' || *(c - 1) != '"') { |
+ return false; |
+ } |
+ if (!ParseProbability(parameter_value_begin + 1, c - 1, &p)) { |
return false; |
} |
} |
@@ -186,7 +190,7 @@ std::string SpdyAltSvcWireFormat::SerializeHeaderFieldValue( |
base::StringAppendF(&value, "; ma=%d", altsvc.max_age); |
} |
if (altsvc.p != 1.0) { |
- base::StringAppendF(&value, "; p=%.2f", altsvc.p); |
+ base::StringAppendF(&value, "; p=\"%.2f\"", altsvc.p); |
} |
} |
return value; |