aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlxmlhttprequest.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2015-04-28 16:03:07 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-05-03 16:33:26 +0000
commit6c1d99c2490e1af5c42d03cf10e8fe4d2e30c025 (patch)
tree0249d973d1b99e201463de7e35efb621ff6e044f /src/qml/qml/qqmlxmlhttprequest.cpp
parentb999aaaf4e3f4069fb57e016cfa7461eb15e0992 (diff)
Fix default value for XMLHttpRequest.response property
The default value for responseType is the empty string, for which the expected data type for the response property is a string - same as when the response type is set to "text". In other words: By default the response property should contain the string representation of the data. Task-number: QTBUG-45862 Change-Id: I563160e5cdfbf93aca7e283e455d77a6b9deceb4 Reviewed-by: Pasi Keränen <pasi.keranen@digia.com> Reviewed-by: Valery Kotov <kotov.valery@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlxmlhttprequest.cpp')
-rw-r--r--src/qml/qml/qqmlxmlhttprequest.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp
index a2c5f09061..2a3ede6a22 100644
--- a/src/qml/qml/qqmlxmlhttprequest.cpp
+++ b/src/qml/qml/qqmlxmlhttprequest.cpp
@@ -1982,7 +1982,7 @@ ReturnedValue QQmlXMLHttpRequestCtor::method_get_response(CallContext *ctx)
return QV4::Encode(scope.engine->newString(QString()));
const QString& responseType = r->responseType();
- if (responseType.compare(QLatin1String("text"), Qt::CaseInsensitive) == 0) {
+ if (responseType.compare(QLatin1String("text"), Qt::CaseInsensitive) == 0 || responseType.isEmpty()) {
return QV4::Encode(scope.engine->newString(r->responseBody()));
} else if (responseType.compare(QLatin1String("arraybuffer"), Qt::CaseInsensitive) == 0) {
return QV4::Encode(scope.engine->newArrayBuffer(r->rawResponseBody()));