| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2005-2007 Alexey Proskuryakov <ap@webkit.org> | 3 * Copyright (C) 2005-2007 Alexey Proskuryakov <ap@webkit.org> |
| 4 * Copyright (C) 2007, 2008 Julien Chaffraix <jchaffraix@webkit.org> | 4 * Copyright (C) 2007, 2008 Julien Chaffraix <jchaffraix@webkit.org> |
| 5 * Copyright (C) 2008, 2011 Google Inc. All rights reserved. | 5 * Copyright (C) 2008, 2011 Google Inc. All rights reserved. |
| 6 * Copyright (C) 2012 Intel Corporation | 6 * Copyright (C) 2012 Intel Corporation |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Lesser General Public | 9 * modify it under the terms of the GNU Lesser General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 } | 587 } |
| 588 | 588 |
| 589 void XMLHttpRequest::send(const String& body, ExceptionCode& ec) | 589 void XMLHttpRequest::send(const String& body, ExceptionCode& ec) |
| 590 { | 590 { |
| 591 if (!initSend(ec)) | 591 if (!initSend(ec)) |
| 592 return; | 592 return; |
| 593 | 593 |
| 594 if (!body.isNull() && areMethodAndURLValidForSend()) { | 594 if (!body.isNull() && areMethodAndURLValidForSend()) { |
| 595 String contentType = getRequestHeader("Content-Type"); | 595 String contentType = getRequestHeader("Content-Type"); |
| 596 if (contentType.isEmpty()) { | 596 if (contentType.isEmpty()) { |
| 597 setRequestHeaderInternal("Content-Type", "application/xml"); | 597 setRequestHeaderInternal("Content-Type", "text/plain;charset=UTF-8")
; |
| 598 } else { | 598 } else { |
| 599 replaceCharsetInMediaType(contentType, "UTF-8"); | 599 replaceCharsetInMediaType(contentType, "UTF-8"); |
| 600 m_requestHeaders.set("Content-Type", contentType); | 600 m_requestHeaders.set("Content-Type", contentType); |
| 601 } | 601 } |
| 602 | 602 |
| 603 m_requestEntityBody = FormData::create(UTF8Encoding().normalizeAndEncode
(body, WTF::EntitiesForUnencodables)); | 603 m_requestEntityBody = FormData::create(UTF8Encoding().normalizeAndEncode
(body, WTF::EntitiesForUnencodables)); |
| 604 if (m_upload) | 604 if (m_upload) |
| 605 m_requestEntityBody->setAlwaysStream(true); | 605 m_requestEntityBody->setAlwaysStream(true); |
| 606 } | 606 } |
| 607 | 607 |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1249 { | 1249 { |
| 1250 return &m_eventTargetData; | 1250 return &m_eventTargetData; |
| 1251 } | 1251 } |
| 1252 | 1252 |
| 1253 EventTargetData* XMLHttpRequest::ensureEventTargetData() | 1253 EventTargetData* XMLHttpRequest::ensureEventTargetData() |
| 1254 { | 1254 { |
| 1255 return &m_eventTargetData; | 1255 return &m_eventTargetData; |
| 1256 } | 1256 } |
| 1257 | 1257 |
| 1258 } // namespace WebCore | 1258 } // namespace WebCore |
| OLD | NEW |