瀏覽代碼

minor cookie domain issue

David Rose 18 年之前
父節點
當前提交
203c39ab7a
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      panda/src/downloader/httpCookie.cxx

+ 6 - 0
panda/src/downloader/httpCookie.cxx

@@ -210,6 +210,12 @@ parse_cookie_param(const string &param, bool first_param) {
     } else if (key == "domain") {
     } else if (key == "domain") {
       _domain = HTTPChannel::downcase(value);
       _domain = HTTPChannel::downcase(value);
 
 
+      // From RFC 2965: If an explicitly specified value does not
+      // start with a dot, the user agent supplies a leading dot.
+      if (!_domain.empty() && _domain[0] != '.') {
+        _domain = string(".") + _domain;
+      }
+
     } else if (key == "secure") {
     } else if (key == "secure") {
       _secure = true;
       _secure = true;