Bug 1362099 - Make RESTRequest handle GET's where the response is > 8192 bytes and we know the charset r=markh

MozReview-Commit-ID: 6g8hCvr7ZbJ

--HG--
extra : rebase_source : 740e44f4cf6be265e2c04a78d4737a118f0a1b3f
This commit is contained in:
Thom Chiovoloni 2017-05-05 16:29:01 -04:00
parent 21816ce4f3
commit 0c6fcd0d50

View File

@ -523,14 +523,18 @@ RESTRequest.prototype = {
this._converterStream = Cc["@mozilla.org/intl/converter-input-stream;1"]
.createInstance(Ci.nsIConverterInputStream);
}
this._converterStream.init(stream, channel.contentCharset, 0,
this._converterStream.DEFAULT_REPLACEMENT_CHARACTER);
try {
let str = {};
let num = this._converterStream.readString(count, str);
if (num != 0) {
let remaining = count;
while (remaining > 0) {
let str = {};
let num = this._converterStream.readString(remaining, str);
if (!num) {
break;
}
remaining -= num;
this.response.body += str.value;
}
} catch (ex) {