Closed pdhodgkinson closed 4 years ago
Hello @pdhodgkinson, thanks for noticing this issue!
Can you confirm that this change solves your issue: https://github.com/MunifTanjim/node-bitbucket/pull/52 ?
Hello @pdhodgkinson, thanks for noticing this issue!
Can you confirm that this change solves your issue: #52 ?
Yes! It works correctly with #52. Thanks for the quick turnaround!
@pdhodgkinson
Published bitbucket@2.0.3 :tada:
It appears the PUT requests (possibly POSTS as well?) that have no body content are failing with a 400 status code error. In my example using
bitbucket.repositories.addDefaultReviewer( { workspace, repo_slug, target_username})
which uses a url like/repositories/{workspace}/{repo_slug}/default-reviewers/{target_username}
to attach a default reviewer to a repo, and has no body content, does not work.I have successfully called the same endpoint in PostMan without a 400.
In my testing the difference is the passing of the
content-type: application/json
header. Adding this to the POSTman request causes a similar 400 error. Removing it allows the request to go through successfully.I attempt to use hooks to intercept the request and remove the header, but the header must be added further on in the flow as it wasn't present in the options at before-hook time, yet the error response shows it is present.