Skip to content
This repository has been archived by the owner on Oct 24, 2019. It is now read-only.

fix double parsing of response.body #159

Merged
merged 2 commits into from
Sep 4, 2017
Merged

Conversation

spruce
Copy link
Contributor

@spruce spruce commented Jan 27, 2017

when the response body is already an object don't try to parse it again
should be fixing #149

This is of interest for me because I have a project which fails because of that problem.
piceaTech/node-gitlab-2-github#16

when the response body is already an object don't try to parse it again
should be fixing moul#149
fn err, ret || response.body.message
else
fn err, ret || JSON.parse(response.body).message
when 3 then fn err, response, ret

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line ends with trailing whitespace.

@@ -43,8 +43,12 @@ class module.exports.ApiBaseHTTP extends ApiBase
arity = fn.length
switch arity
when 1 then fn ret
when 2 then fn err, ret || JSON.parse(response.body).message
when 3 then fn err, response, ret
when 2

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line ends with trailing whitespace.

@spruce
Copy link
Contributor Author

spruce commented Apr 4, 2017

ping @moul

@spruce
Copy link
Contributor Author

spruce commented Apr 22, 2017

ping @dave-irvine

@cdbishop
Copy link

+1, I'm encountering the issue (#149) that this addresses.

@dave-irvine dave-irvine merged commit ad0ce2f into moul:develop Sep 4, 2017
@spruce
Copy link
Contributor Author

spruce commented Sep 13, 2017

Thanks @dave-irvine ❤️

@spruce
Copy link
Contributor Author

spruce commented Sep 13, 2017

Could you also release a new version on npm?

@spruce spruce deleted the patch-1 branch September 13, 2017 21:32
kahirul pushed a commit to exporto/node-gitlab that referenced this pull request Sep 16, 2017
* fix double parsing of response.body

when the response body is already an object don't try to parse it again
should be fixing moul#149

* update to make houndci happy
moul added a commit that referenced this pull request Mar 30, 2018
* develop:
  fix double parsing of response.body (#159)
  Fixed API doc, merge request acceptance and protect branch with parameters (#177)
  Fixed repository.showCommit + Added repository.deleteTag (#157)
  Add project share endpoint (#156)
  Issues, edit method doesn't work and remove method missing (#150)
  Add new APIs (#148)
  Extend groups (#124)
  Add Trigger API and fix Build API bug (#132)
  Added subscriptions api for issues (#146)
  Pass an optional params object to the list builds API. (#147)
  Post-release version bump
  add `addTag` API
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants