Keep XMLHttpRequest response data after receiving a server error
authorTopi Reinio <topi.reinio@nokia.com>
Wed, 18 Apr 2012 12:55:02 +0000 (14:55 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 1 May 2012 04:06:51 +0000 (06:06 +0200)
commit0949071f13e7bcbc16a0f07f496e0b6a23b04edd
tree26aba383a6484a455874cb9d8b0f561598e51ae3
parente39908c658c6caa2013bc7356eb904b669af1bfb
Keep XMLHttpRequest response data after receiving a server error

Fix XMLHttpRequest.responseText being set to empty string whenever a
server status code other than '200/OK' is received. XMLHttpRequest
specification says that response entity body is to be returned unless
the error flag is set, and the flag is set only in case of abort() or
network error. This change enables clients to receive additional error
information the server may return in the response body.

http://www.w3.org/TR/XMLHttpRequest/#the-responsetext-attribute

Task-number: QTBUG-21706

Change-Id: I7e44f481494dc7eddea3868d6f92ee45d7ab0c69
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
Reviewed-by: Bea Lam <bea.lam@nokia.com>
src/qml/qml/qqmlxmlhttprequest.cpp
tests/auto/qml/qqmlxmlhttprequest/data/status.400.reply
tests/auto/qml/qqmlxmlhttprequest/data/status.qml
tests/auto/qml/qqmlxmlhttprequest/data/statusText.qml
tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp