-
Type:
Bug
-
Resolution: Fixed
-
Priority:
High
-
Component/s: Repository - Source
-
None
-
2
-
Severity 3 - Minor
-
591
Issue Summary
When we download a file using this API: https://api.bitbucket.org/2.0/repositories/<workspace>/<repo_slug>/src/<commit>/<path>, this endpoint returns the raw contents. The response's Content-Type is derived from the filename extension (not from the contents). The file contents are not processed and no character encoding/recoding is performed, and as a result, no character encoding is included as part of the Content-Type. This leads to a different filesize than the actual filesize.
Steps to Reproduce
- Use the API endpoint https://api.bitbucket.org/2.0/repositories/<workspace>/<repo_slug>/src/<commit>/<path> to download a file.
- Observe the Content-Type and filesize of the downloaded file.
Expected Results
The Content-Type should include character encoding, and the filesize should match the actual filesize of the file.
Actual Results
The Content-Type is derived from the filename extension without character encoding, leading to a different filesize than the actual filesize.
Workaround
Cloning the repository instead of fetching it using the API.