mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
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:
parent
21816ce4f3
commit
0c6fcd0d50
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user