[4.6] Slashes in file path used in Src and Downloads API classes are url-encoded #83
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Slashes in file path used in Src and Downloads API classes are url-encoded, which makes it impossible to get metadata or get the content of files from a repository unless the file is in the project root.
For example, in case of
\Bitbucket\Api\Repositories\Workspaces\Src::download()
, if I want to download a file from my project's subfolder:...then I expect that the client fetches the data from the URI string
https://api.bitbucket.org/2.0/repositories/my-workspace/my-project/src/main/docs/foo/BAR.md
,but the URI string will be
https://api.bitbucket.org/2.0/repositories/my-workspace/my-project/src/main/docs%2Ffoo%2FBAR.md
, which will obviously fail to return the file's content (and throws an API error instead).Methods affected:
\Bitbucket\Api\Repositories\Workspaces\Src::show()
\Bitbucket\Api\Repositories\Workspaces\Src::download()
\Bitbucket\Api\Repositories\Workspaces\Downloads::download()
\Bitbucket\Api\Repositories\Workspaces\Downloads::remove()
Added a new test which hopefully describes my issue more clearly.
Asking for a review, and last but not least, thank you for this Bitbucket Client!