summaryrefslogtreecommitdiff
path: root/Source/WebCore/xml/XMLHttpRequest.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-10-17 16:21:14 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-10-17 16:21:14 +0200
commit8995b83bcbfbb68245f779b64e5517627c6cc6ea (patch)
tree17985605dab9263cc2444bd4d45f189e142cca7c /Source/WebCore/xml/XMLHttpRequest.cpp
parentb9c9652036d5e9f1e29c574f40bc73a35c81ace6 (diff)
downloadqtwebkit-8995b83bcbfbb68245f779b64e5517627c6cc6ea.tar.gz
Imported WebKit commit cf4f8fc6f19b0629f51860cb2d4b25e139d07e00 (http://svn.webkit.org/repository/webkit/trunk@131592)
New snapshot that includes the build fixes for Mac OS X 10.6 and earlier as well as the previously cherry-picked changes
Diffstat (limited to 'Source/WebCore/xml/XMLHttpRequest.cpp')
-rw-r--r--Source/WebCore/xml/XMLHttpRequest.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/Source/WebCore/xml/XMLHttpRequest.cpp b/Source/WebCore/xml/XMLHttpRequest.cpp
index 097bc4427..f61690854 100644
--- a/Source/WebCore/xml/XMLHttpRequest.cpp
+++ b/Source/WebCore/xml/XMLHttpRequest.cpp
@@ -929,7 +929,7 @@ void XMLHttpRequest::setRequestHeaderInternal(const AtomicString& name, const St
{
HTTPHeaderMap::AddResult result = m_requestHeaders.add(name, value);
if (!result.isNewEntry)
- result.iterator->second.append(", " + value);
+ result.iterator->value.append(", " + value);
}
String XMLHttpRequest::getRequestHeader(const AtomicString& name) const
@@ -956,16 +956,16 @@ String XMLHttpRequest::getAllResponseHeaders(ExceptionCode& ec) const
// 2) There's no known harm in hiding Set-Cookie header fields entirely; we don't
// know any widely used technique that requires access to them.
// 3) Firefox has implemented this policy.
- if (isSetCookieHeader(it->first) && !securityOrigin()->canLoadLocalResources())
+ if (isSetCookieHeader(it->key) && !securityOrigin()->canLoadLocalResources())
continue;
- if (!m_sameOriginRequest && !isOnAccessControlResponseHeaderWhitelist(it->first) && !accessControlExposeHeaderSet.contains(it->first))
+ if (!m_sameOriginRequest && !isOnAccessControlResponseHeaderWhitelist(it->key) && !accessControlExposeHeaderSet.contains(it->key))
continue;
- stringBuilder.append(it->first);
+ stringBuilder.append(it->key);
stringBuilder.append(':');
stringBuilder.append(' ');
- stringBuilder.append(it->second);
+ stringBuilder.append(it->value);
stringBuilder.append('\r');
stringBuilder.append('\n');
}
@@ -1116,7 +1116,11 @@ void XMLHttpRequest::didReceiveResponse(unsigned long identifier, const Resource
InspectorInstrumentation::didReceiveXHRResponse(scriptExecutionContext(), identifier);
m_response = response;
- m_responseEncoding = extractCharsetFromMediaType(m_mimeTypeOverride);
+ if (!m_mimeTypeOverride.isEmpty()) {
+ m_response.setHTTPHeaderField("Content-Type", m_mimeTypeOverride);
+ m_responseEncoding = extractCharsetFromMediaType(m_mimeTypeOverride);
+ }
+
if (m_responseEncoding.isEmpty())
m_responseEncoding = response.textEncodingName();
}