From 8d7d6d4f417c7ed01af2351558ae28134a9354fa Mon Sep 17 00:00:00 2001 From: arafato Date: Tue, 13 Mar 2018 12:41:00 +0100 Subject: [PATCH] merges bugfixes from #163 --- lib/model/table/AzuriteTableRequest.js | 2 +- lib/model/table/RequestPayloadParser.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/model/table/AzuriteTableRequest.js b/lib/model/table/AzuriteTableRequest.js index b9676ea..4aaa1a0 100644 --- a/lib/model/table/AzuriteTableRequest.js +++ b/lib/model/table/AzuriteTableRequest.js @@ -32,7 +32,7 @@ class AzuriteTableRequest { } _initHttpProps(httpHeaders) { - this.httpProps[N.CONTENT_TYPE] = httpHeaders[N.CONTENT_TYPE] || `application/json;`; + this.httpProps[N.CONTENT_TYPE] = httpHeaders[N.CONTENT_TYPE] || `application/json`; this.httpProps[N.ACCEPT] = httpHeaders[N.ACCEPT] || `application/json;odata=nometadata`; this.httpProps[N.PREFER] = httpHeaders[N.PREFER] || `return-content`; } diff --git a/lib/model/table/RequestPayloadParser.js b/lib/model/table/RequestPayloadParser.js index e11441b..5b9c616 100644 --- a/lib/model/table/RequestPayloadParser.js +++ b/lib/model/table/RequestPayloadParser.js @@ -7,14 +7,14 @@ class RequestPayLoadParser { } parse(contentType, body) { - if (body.length === 0) { + if (!body.length || body.length === 0) { return {}; } switch (contentType) { - case 'application/atom+xml;': + case 'application/atom+xml': throw new IAError(`accept value of 'atom+xml' is currently not supported by Azurite`); break; - case 'application/json;': + case 'application/json': const txt = body.toString('utf8'); return JSON.parse(txt); break;