src/3rdparty/webkit/WebCore/platform/network/qt/ResourceRequestQt.cpp
changeset 2 56cd8111b7f7
parent 1 ae9c8dab0e3e
child 3 41300fa6a67c
equal deleted inserted replaced
1:ae9c8dab0e3e 2:56cd8111b7f7
    36     const HTTPHeaderMap &headers = httpHeaderFields();
    36     const HTTPHeaderMap &headers = httpHeaderFields();
    37     for (HTTPHeaderMap::const_iterator it = headers.begin(), end = headers.end();
    37     for (HTTPHeaderMap::const_iterator it = headers.begin(), end = headers.end();
    38          it != end; ++it) {
    38          it != end; ++it) {
    39         QByteArray name = QString(it->first).toAscii();
    39         QByteArray name = QString(it->first).toAscii();
    40         QByteArray value = QString(it->second).toAscii();
    40         QByteArray value = QString(it->second).toAscii();
    41         // QNetworkRequest::setRawHeader() would remove the header if the value is null
    41         request.setRawHeader(name, value);
    42         // Make sure to set an empty header instead of null header.
       
    43         if (!value.isNull())
       
    44             request.setRawHeader(name, value);
       
    45         else
       
    46             request.setRawHeader(name, "");
       
    47     }
    42     }
    48 
    43 
    49     switch (cachePolicy()) {
    44     switch (cachePolicy()) {
    50     case ReloadIgnoringCacheData:
    45     case ReloadIgnoringCacheData:
    51         request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::AlwaysNetwork);
    46         request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::AlwaysNetwork);