Skip to content
This repository has been archived by the owner on Jul 23, 2020. It is now read-only.

Commit

Permalink
fix: non empty body results in content-length=2 header in request, fa…
Browse files Browse the repository at this point in the history
…iling api calls
  • Loading branch information
okonech committed Jul 19, 2020
1 parent 7bbcf61 commit 674f218
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 14 deletions.
3 changes: 1 addition & 2 deletions api/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ function CommentClient(jiraClient) {
}
var basePath = '/comment/' + opts.commentId + "/properties";
if (!qs) qs = {};
if (!body) body = {};

if (opts.fields) {
qs.fields = '';
Expand All @@ -128,9 +127,9 @@ function CommentClient(jiraClient) {
}

return {
...(body && { body }),
uri: this.jiraClient.buildURL(basePath + path),
method: method,
body: body,
qs: qs,
followAllRedirects: true,
json: true
Expand Down
3 changes: 1 addition & 2 deletions api/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ function FilterClient(jiraClient) {
this.buildRequestOptions = function (opts, path, method, body, qs) {
var basePath = '/filter/' + opts.filterId;
if (!qs) qs = {};
if (!body) body = {};

if (opts.fields) {
qs.fields = '';
Expand All @@ -275,9 +274,9 @@ function FilterClient(jiraClient) {
}

return {
...(body && { body }),
uri: this.jiraClient.buildURL(basePath + path),
method: method,
body: body,
qs: qs,
followAllRedirects: true,
json: true
Expand Down
3 changes: 1 addition & 2 deletions api/issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,6 @@ function IssueClient(jiraClient) {
var idOrKey = opts.issueId || opts.issueKey;
var basePath = '/issue/' + idOrKey;
if (!qs) qs = {};
if (!body) body = {};

if (opts.fields) {
qs.fields = '';
Expand All @@ -1322,9 +1321,9 @@ function IssueClient(jiraClient) {
}

return {
...(body && { body }),
uri: this.jiraClient.buildURL(basePath + path),
method: method,
body: body,
qs: qs,
followAllRedirects: true,
json: true
Expand Down
3 changes: 1 addition & 2 deletions api/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ function ProjectClient(jiraClient) {
var basePath = opts.projectIdOrKey ? '/project/' + opts.projectIdOrKey : '/project';

if (!qs) qs = {};
if (!body) body = {};

if (opts.fields) {
qs.fields = '';
Expand All @@ -318,9 +317,9 @@ function ProjectClient(jiraClient) {
}

return {
...(body && { body }),
uri: this.jiraClient.buildURL(basePath + path),
method: method,
body: body,
qs: qs,
followAllRedirects: true,
json: true
Expand Down
3 changes: 1 addition & 2 deletions api/screens.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ function ScreensClient(jiraClient) {
this.buildRequestOptions = function (opts, path, method, body, qs) {
var basePath = '/screens/' + opts.screenId;
if (!qs) qs = {};
if (!body) body = {};

if (opts.fields) {
qs.fields = '';
Expand All @@ -239,9 +238,9 @@ function ScreensClient(jiraClient) {
}

return {
...(body && { body }),
uri: this.jiraClient.buildURL(basePath + path),
method: method,
body: body,
qs: qs,
followAllRedirects: true,
json: true
Expand Down
3 changes: 1 addition & 2 deletions api/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ function VersionClient(jiraClient) {
this.buildRequestOptions = function (opts, path, method, body, qs) {
var basePath = '/version/' + opts.versionId;
if (!qs) qs = {};
if (!body) body = {};

if (opts.fields) {
qs.fields = '';
Expand All @@ -312,9 +311,9 @@ function VersionClient(jiraClient) {
}

return {
...(body && { body }),
uri: this.jiraClient.buildURL(basePath + path),
method: method,
body: body,
qs: qs,
followAllRedirects: true,
json: true
Expand Down
3 changes: 1 addition & 2 deletions api/workflowScheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,6 @@ function WorkflowSchemeClient(jiraClient) {
this.buildRequestOptions = function (opts, path, method, body, qs) {
var basePath = '/workflowscheme/' + opts.workflowSchemeId;
if (!qs) qs = {};
if (!body) body = {};

if (opts.fields) {
qs.fields = '';
Expand All @@ -509,9 +508,9 @@ function WorkflowSchemeClient(jiraClient) {
}

return {
...(body && { body }),
uri: this.jiraClient.buildURL(basePath + path),
method: method,
body: body,
qs: qs,
followAllRedirects: true,
json: true
Expand Down

0 comments on commit 674f218

Please sign in to comment.