Skip to content

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

Merged
jzunigax2 merged 2 commits into
masterfrom
fix/url-encode-on-get-by-paths
Sep 21, 2026
Merged

jzunigax2 merged 2 commits 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
@jzunigax2
jzunigax2 force-pushed the fix/url-encode-on-get-by-paths branch from 9c64096 to d24adb2 Compare September 21, 2026 13:02
@jzunigax2
jzunigax2 merged commit ff8bccb into master Sep 21, 2026
1 check passed
@jzunigax2
jzunigax2 deleted the fix/url-encode-on-get-by-paths branch September 21, 2026 13:16
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.

2 participants