Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / net / cookies / parsed_cookie.cc
index 60e0bbb..6d82d9e 100644 (file)
@@ -391,7 +391,7 @@ void ParsedCookie::ParseTokenValuePairs(const std::string& cookie_line) {
 
     // From RFC2109: "Attributes (names) (attr) are case-insensitive."
     if (pair_num != 0)
-      StringToLowerASCII(&pair.first);
+      base::StringToLowerASCII(&pair.first);
     // Ignore Set-Cookie directives contaning control characters. See
     // http://crbug.com/238041.
     if (!IsValidCookieAttributeValue(pair.first) ||
@@ -410,6 +410,12 @@ void ParsedCookie::ParseTokenValuePairs(const std::string& cookie_line) {
 }
 
 void ParsedCookie::SetupAttributes() {
+  // Ignore Set-Cookie directive where name and value are both empty.
+  if (pairs_[0].first.empty() && pairs_[0].second.empty()) {
+    pairs_.clear();
+    return;
+  }
+
   // We skip over the first token/value, the user supplied one.
   for (size_t i = 1; i < pairs_.size(); ++i) {
     if (pairs_[i].first == kPathTokenName) {