Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a resource returns HTTP 201. #83

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

realyze
Copy link

@realyze realyze commented Sep 26, 2014

It might be better to relax the statusCode checks a bit (i.e., consider things to be OK if statusCode is in the 2xx family).

@@ -668,7 +668,51 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
return;
}

if (response.statusCode !== 200) {
if (response.statusCode / 100 | 0 != 2) {

Choose a reason for hiding this comment

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

This check is made in two places. Could you extract it to a helper function like is200ErrorCode?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants