-
Bug
-
Resolution: Unresolved
-
Medium
-
None
-
Severity 2 - Major
-
13
-
Issue Summary
When making an API request that has some uppercase letters in the application/json Content-Type header (e.g. Application/JSON, or application/Json, etc), the request returns a 500 response.
Steps to Reproduce
- Run an API call like the following to update the title of an open PR in a Bitbucket Cloud repo
curl -u username:app_password --request PUT \ --url 'https://api.bitbucket.org/2.0/repositories/workspace-id/repo-slug/pullrequests/23' \ --header 'Accept: application/json' \ --header 'Content-Type: Application/JSON' \ --data '{ "title": "Updated PR title" }'
Expected Results
The request succeeds.
Actual Results
The request returns a 500 error with the message "Something went wrong".
Workaround
Use lowercase in the application/json Content-Type header:
curl -u username:app_password --request PUT \ --url 'https://api.bitbucket.org/2.0/repositories/workspace-id/repo-slug/pullrequests/23' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "title": "Updated PR title" }'