src/network/access/qnetworkrequest.cpp
changeset 7 f7bc934e204c
parent 3 41300fa6a67c
child 30 5dc02b23752f
equal deleted inserted replaced
3:41300fa6a67c 7:f7bc934e204c
     1 /****************************************************************************
     1 /****************************************************************************
     2 **
     2 **
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     4 ** All rights reserved.
     4 ** All rights reserved.
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     6 **
     6 **
     7 ** This file is part of the QtNetwork module of the Qt Toolkit.
     7 ** This file is part of the QtNetwork module of the Qt Toolkit.
     8 **
     8 **
   136         If present, it indicates that the server is redirecting the
   136         If present, it indicates that the server is redirecting the
   137         request to a different URL. The Network Access API does not by
   137         request to a different URL. The Network Access API does not by
   138         default follow redirections: it's up to the application to
   138         default follow redirections: it's up to the application to
   139         determine if the requested redirection should be allowed,
   139         determine if the requested redirection should be allowed,
   140         according to its security policies.
   140         according to its security policies.
       
   141         The returned URL might be relative. Use QUrl::resolved()
       
   142         to create an absolute URL out of it.
   141 
   143 
   142     \value ConnectionEncryptedAttribute
   144     \value ConnectionEncryptedAttribute
   143         Replies only, type: QVariant::Bool (default: false)
   145         Replies only, type: QVariant::Bool (default: false)
   144         Indicates whether the data was obtained through an encrypted
   146         Indicates whether the data was obtained through an encrypted
   145         (secure) connection.
   147         (secure) connection.
   647 
   649 
   648 static QVariant parseCookieHeader(const QByteArray &raw)
   650 static QVariant parseCookieHeader(const QByteArray &raw)
   649 {
   651 {
   650     QList<QNetworkCookie> result;
   652     QList<QNetworkCookie> result;
   651     QList<QByteArray> cookieList = raw.split(';');
   653     QList<QByteArray> cookieList = raw.split(';');
   652     foreach (QByteArray cookie, cookieList) {
   654     foreach (const QByteArray &cookie, cookieList) {
   653         QList<QNetworkCookie> parsed = QNetworkCookie::parseCookies(cookie.trimmed());
   655         QList<QNetworkCookie> parsed = QNetworkCookie::parseCookies(cookie.trimmed());
   654         if (parsed.count() != 1)
   656         if (parsed.count() != 1)
   655             return QVariant();  // invalid Cookie: header
   657             return QVariant();  // invalid Cookie: header
   656 
   658 
   657         result += parsed;
   659         result += parsed;