Skip to content

[BR-2340]: fix/add url encoding to the getFolder/FileByPath functions - #440

Open
jzunigax2 wants to merge 1 commit into
masterfrom
fix/url-encode-on-get-by-paths
Open

jzunigax2 wants to merge 1 commit into
masterfrom
fix/url-encode-on-get-by-paths

Conversation

@jzunigax2

Copy link
Copy Markdown
Contributor

getFolderByPath and getFileByPath interpolated their argument straight into the query string:

this.client.get(folders/meta?path=${folderPath}, this.headers());

Any reserved character in an item name therefore changed the request rather than the value. & starts a new query param and # is dropped as a fragment before the request is even sent, so both truncate the path — /a&b.txt reaches the API as /a. A literal %2F in a name is decoded server-side into a path separator, and + into a space. In every case the API gets a syntactically valid but different path, so the lookup 404s on an item that exists, or resolves to the wrong one.

Both methods now build the query with URLSearchParams, matching getFolderContentByUuid and getFavorites

No client aside from cli calls these methods

@jzunigax2 jzunigax2 added the bug Something isn't working label Sep 18, 2026
@jzunigax2 jzunigax2 self-assigned this Sep 18, 2026
@jzunigax2
jzunigax2 requested a review from CandelR September 18, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant