From 8f247b295293ec3940f3d73405c6f4e075a29208 Mon Sep 17 00:00:00 2001 From: Gregory Szorc Date: Tue, 24 Jul 2012 11:43:57 -0700 Subject: [PATCH] Bug 776770 - Remove newline encoding from storage service server; r=rnewman Functionality removed from spec in bug 775798. --- services/common/storageserver.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/services/common/storageserver.js b/services/common/storageserver.js index 520fc48cc2ff..7e4909b3eaec 100644 --- a/services/common/storageserver.js +++ b/services/common/storageserver.js @@ -711,9 +711,7 @@ StorageServerCollection.prototype = { if (newlines) { response.setHeader("Content-Type", "application/newlines", false); let normalized = data.map(function map(d) { - let result = JSON.stringify(d); - - return result.replace("\n", "\\u000a"); + return JSON.stringify(d); }); body = normalized.join("\n") + "\n"; @@ -756,10 +754,9 @@ StorageServerCollection.prototype = { } } else if (inputMediaType == "application/newlines") { for each (let line in inputBody.split("\n")) { - let json = line.replace("\\u000a", "\n"); let record; try { - record = JSON.parse(json); + record = JSON.parse(line); } catch (ex) { this._log.info("JSON parse error on line!"); return sendMozSvcError(request, response, "8");