roccomuso / node-webhooks

:arrow_right_hook: Node.js module to create and trigger your own webHooks.
190 stars 47 forks source link

Why only accept http status 200? #11

Closed yss14 closed 7 years ago

yss14 commented 7 years ago

Why does node-webhooks only fire the success event, if the response has a http status code of 200? In my opinion at least 201 till 204 are also valid and common response codes.

roccomuso commented 7 years ago

Yep. You're right. PR are welcome. :+1:

yss14 commented 7 years ago

Should it be configable via options or hard coded?

roccomuso commented 7 years ago

@yss14 I guess we can easily hard-code for now.. A simple [200, 201, 203, 204].indexOf(statusCode) === -1 here would be enough.


Edit: I saw the PR#12. It's fine. Let me see if we can bump also some dependencies and increase test coverage. This could be added to the tests.. let's try to improve the coverage and update doc.

roccomuso commented 7 years ago

Closed with #12