src/network/access/qnetworkcookiejar.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
   190                           cookie.expirationDate() < now;
   190                           cookie.expirationDate() < now;
   191 
   191 
   192         // validate the cookie & set the defaults if unset
   192         // validate the cookie & set the defaults if unset
   193         if (cookie.path().isEmpty())
   193         if (cookie.path().isEmpty())
   194             cookie.setPath(defaultPath);
   194             cookie.setPath(defaultPath);
   195         else if (!isParentPath(pathAndFileName, cookie.path()))
   195         // don't do path checking. See http://bugreports.qt.nokia.com/browse/QTBUG-5815
   196             continue;           // not accepted
   196 //        else if (!isParentPath(pathAndFileName, cookie.path())) {
   197 
   197 //            continue;           // not accepted
       
   198 //        }
   198         if (cookie.domain().isEmpty()) {
   199         if (cookie.domain().isEmpty()) {
   199             cookie.setDomain(defaultDomain);
   200             cookie.setDomain(defaultDomain);
   200         } else {
   201         } else {
       
   202             // Ensure the domain starts with a dot if its field was not empty
       
   203             // in the HTTP header. There are some servers that forget the
       
   204             // leading dot and this is actually forbidden according to RFC 2109,
       
   205             // but all browsers accept it anyway so we do that as well.
       
   206             if (!cookie.domain().startsWith(QLatin1Char('.')))
       
   207                 cookie.setDomain(QLatin1Char('.') + cookie.domain());
       
   208 
   201             QString domain = cookie.domain();
   209             QString domain = cookie.domain();
   202             if (!(isParentDomain(domain, defaultDomain)
   210             if (!(isParentDomain(domain, defaultDomain)
   203                 || isParentDomain(defaultDomain, domain))) {
   211                 || isParentDomain(defaultDomain, domain))) {
   204                     continue;           // not accepted
   212                     continue;           // not accepted
   205             }
   213             }