~ubuntu-branches/ubuntu/utopic/kde4libs/utopic

« back to all changes in this revision

Viewing changes to kioslave/http/kcookiejar/kcookiejar.cpp

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2012-05-13 15:42:30 UTC
  • mfrom: (1.14.17)
  • Revision ID: package-import@ubuntu.com-20120513154230-2xv2bsi52w6x5lue
Tags: 4:4.8.3-0ubuntu1
* New upstream release
  - Drop kubuntu_fix_nepomuk_utils_crash.diff, applied upstream
  - Add new symbols to libkdecore5.symbols and libkdewebkit5.symbols
  - Update kdelibs5-dev.install and kdelibs5-experimental-dev.install
  - update symbol files for gcc 4.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
372
372
 
373
373
          if( cookie.isSecure() && !secureRequest )
374
374
             continue;
375
 
          
 
375
 
376
376
          if( cookie.isHttpOnly() && useDOMFormat )
377
377
             continue;
378
 
          
 
378
 
379
379
          // Do not send expired cookies.
380
380
          if ( cookie.isExpired())
381
381
          {
395
395
 
396
396
          allCookies.append(cookie);
397
397
       }
398
 
       
 
398
 
399
399
       if (it == itEnd)
400
400
          break; // Finished.
401
401
    }
410
410
    {
411
411
        if (!useDOMFormat)
412
412
            cookieStr = QL1S("Cookie: ");
413
 
        
 
413
 
414
414
        if (protVersion > 0)
415
415
            cookieStr = cookieStr + QL1S("$Version=") + QString::number(protVersion) + QL1S("; ");
416
 
          
 
416
 
417
417
        Q_FOREACH(const KHttpCookie& cookie, allCookies)
418
418
            cookieStr = cookieStr + cookie.cookieStr(useDOMFormat) + QL1S("; ");
419
419
 
537
537
    if (cookie.domain().isEmpty())
538
538
       stripDomain( cookie.host(), domain);
539
539
    else
540
 
       stripDomain( cookie.domain(), domain);
 
540
       domain = cookie.domain();
541
541
    return domain;
542
542
}
543
543
 
789
789
            }
790
790
            else if (isRFC2965 && (Name.compare(QL1S("port"), Qt::CaseInsensitive) == 0 ||
791
791
                     (Name.isEmpty() && Value.compare(QL1S("port"), Qt::CaseInsensitive) == 0)))
792
 
            {              
 
792
            {
793
793
                // Based on the port selection rule of RFC 2965 section 3.3.4...
794
794
                if (Name.isEmpty())
795
795
                {
796
 
                    // We intentionally append a -1 first in orer to distinguish
 
796
                    // We intentionally append a -1 first in order to distinguish
797
797
                    // between only a 'Port' vs a 'Port="80 443"' in the sent cookie.
798
798
                    lastCookie.mPorts.append(-1);
799
799
                    const bool secureRequest = (_url.startsWith(QL1S("https://"), Qt::CaseInsensitive) ||
1158
1158
{
1159
1159
    if (!windowId)
1160
1160
        return;
1161
 
    
 
1161
 
1162
1162
    Q_FOREACH(const QString& domain, m_domainList)
1163
1163
        eatSessionCookies( domain, windowId, false );
1164
1164
}
1252
1252
        KHttpCookieList *cookieList = m_cookieDomains.value(domain);
1253
1253
        if (!cookieList)
1254
1254
            continue;
1255
 
        
 
1255
 
1256
1256
        QMutableListIterator<KHttpCookie> cookieIterator(*cookieList);
1257
1257
        while (cookieIterator.hasNext()) {
1258
1258
            const KHttpCookie& cookie = cookieIterator.next();
1513
1513
        const int sepPos = value.lastIndexOf(QL1C(':'));
1514
1514
        if (sepPos <= 0)
1515
1515
          continue;
1516
 
        
 
1516
 
1517
1517
        const QString domain(value.left(sepPos));
1518
1518
        KCookieAdvice advice = strToAdvice( value.mid(sepPos + 1) );
1519
1519
        setDomainAdvice(domain, advice);