зеркало из https://github.com/mozilla/gecko-dev.git
Bug 776770 - Remove newline encoding from storage service server; r=rnewman
Functionality removed from spec in bug 775798.
This commit is contained in:
Родитель
513366f6cd
Коммит
8f247b2952
|
@ -711,9 +711,7 @@ StorageServerCollection.prototype = {
|
||||||
if (newlines) {
|
if (newlines) {
|
||||||
response.setHeader("Content-Type", "application/newlines", false);
|
response.setHeader("Content-Type", "application/newlines", false);
|
||||||
let normalized = data.map(function map(d) {
|
let normalized = data.map(function map(d) {
|
||||||
let result = JSON.stringify(d);
|
return JSON.stringify(d);
|
||||||
|
|
||||||
return result.replace("\n", "\\u000a");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
body = normalized.join("\n") + "\n";
|
body = normalized.join("\n") + "\n";
|
||||||
|
@ -756,10 +754,9 @@ StorageServerCollection.prototype = {
|
||||||
}
|
}
|
||||||
} else if (inputMediaType == "application/newlines") {
|
} else if (inputMediaType == "application/newlines") {
|
||||||
for each (let line in inputBody.split("\n")) {
|
for each (let line in inputBody.split("\n")) {
|
||||||
let json = line.replace("\\u000a", "\n");
|
|
||||||
let record;
|
let record;
|
||||||
try {
|
try {
|
||||||
record = JSON.parse(json);
|
record = JSON.parse(line);
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
this._log.info("JSON parse error on line!");
|
this._log.info("JSON parse error on line!");
|
||||||
return sendMozSvcError(request, response, "8");
|
return sendMozSvcError(request, response, "8");
|
||||||
|
|
Загрузка…
Ссылка в новой задаче