Index: Source/core/xml/XMLHttpRequest.cpp |
diff --git a/Source/core/xml/XMLHttpRequest.cpp b/Source/core/xml/XMLHttpRequest.cpp |
index 1eb7c1b7940d883a4b6efbfa27cbc75428b83a83..9eb54f8bf09813a96bf40d9f07b59306d57c8293 100644 |
--- a/Source/core/xml/XMLHttpRequest.cpp |
+++ b/Source/core/xml/XMLHttpRequest.cpp |
@@ -640,8 +640,7 @@ void XMLHttpRequest::send(Document* document, ExceptionState& exceptionState) |
return; |
if (areMethodAndURLValidForSend()) { |
- String contentType = getRequestHeader("Content-Type"); |
- if (contentType.isEmpty()) { |
+ if (getRequestHeader("Content-Type").isEmpty()) { |
// FIXME: this should include the charset used for encoding. |
setRequestHeaderInternal("Content-Type", "application/xml"); |
} |
@@ -691,8 +690,7 @@ void XMLHttpRequest::send(Blob* body, ExceptionState& exceptionState) |
return; |
if (areMethodAndURLValidForSend()) { |
- const String& contentType = getRequestHeader("Content-Type"); |
- if (contentType.isEmpty()) { |
+ if (getRequestHeader("Content-Type").isEmpty()) { |
const String& blobType = body->type(); |
if (!blobType.isEmpty() && isValidContentType(blobType)) |
setRequestHeaderInternal("Content-Type", AtomicString(blobType)); |
@@ -1112,7 +1110,7 @@ void XMLHttpRequest::setRequestHeaderInternal(const AtomicString& name, const At |
result.iterator->value = result.iterator->value + ", " + value; |
} |
-AtomicString XMLHttpRequest::getRequestHeader(const AtomicString& name) const |
+const AtomicString& XMLHttpRequest::getRequestHeader(const AtomicString& name) const |
{ |
return m_requestHeaders.get(name); |
} |
@@ -1151,7 +1149,7 @@ String XMLHttpRequest::getAllResponseHeaders(ExceptionState& exceptionState) con |
return stringBuilder.toString(); |
} |
-AtomicString XMLHttpRequest::getResponseHeader(const AtomicString& name, ExceptionState& exceptionState) const |
+const AtomicString& XMLHttpRequest::getResponseHeader(const AtomicString& name, ExceptionState& exceptionState) const |
{ |
if (m_state < HEADERS_RECEIVED || m_error) |
return nullAtom; |