Changeset 33561 in webkit
- Timestamp:
- May 17, 2008 8:41:53 PM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r33559 r33561 1 2008-05-17 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Mark Rowe. 4 5 Re-factor core setRequestHeader logic into setRequestHeaderInternal. 6 7 * xml/XMLHttpRequest.cpp: 8 (WebCore::XMLHttpRequest::sameOriginRequest): 9 (WebCore::XMLHttpRequest::setRequestHeader): 10 (WebCore::XMLHttpRequest::setRequestHeaderInternal): 11 * xml/XMLHttpRequest.h: 12 1 13 2008-05-17 Sam Weinig <sam@webkit.org> 2 14 -
trunk/WebCore/xml/XMLHttpRequest.cpp
r33559 r33561 429 429 request.setHTTPMethod(m_method); 430 430 431 if (!body.isNull() && m_method != "GET" && m_method != "HEAD" && (m_url.protocol ().lower() == "http" || m_url.protocol().lower() == "https")) {431 if (!body.isNull() && m_method != "GET" && m_method != "HEAD" && (m_url.protocolIs("http") || m_url.protocolIs("https"))) { 432 432 String contentType = getRequestHeader("Content-Type"); 433 433 if (contentType.isEmpty()) { 434 ExceptionCode ec = 0;435 434 #if ENABLE(DASHBOARD_SUPPORT) 436 435 Settings* settings = m_doc->settings(); 437 436 if (settings && settings->usesDashboardBackwardCompatibilityMode()) 438 setRequestHeader ("Content-Type", "application/x-www-form-urlencoded", ec);437 setRequestHeaderInternal("Content-Type", "application/x-www-form-urlencoded"); 439 438 else 440 439 #endif 441 setRequestHeader("Content-Type", "application/xml", ec); 442 ASSERT(ec == 0); 440 setRequestHeaderInternal("Content-Type", "application/xml"); 443 441 } 444 442 445 443 // FIXME: must use xmlEncoding for documents. 446 444 String charset = "UTF-8"; 447 445 448 446 TextEncoding encoding(charset); 449 447 if (!encoding.isValid()) // FIXME: report an error? … … 634 632 } 635 633 634 setRequestHeaderInternal(name, value); 635 } 636 637 void XMLHttpRequest::setRequestHeaderInternal(const String& name, const String& value) 638 { 636 639 if (!m_requestHeaders.contains(name)) { 637 640 m_requestHeaders.set(name, value); -
trunk/WebCore/xml/XMLHttpRequest.h
r33559 r33561 109 109 110 110 String getRequestHeader(const String& name) const; 111 void setRequestHeaderInternal(const String& name, const String& value); 111 112 112 113 void changeState(XMLHttpRequestState newState);
Note: See TracChangeset
for help on using the changeset viewer.