Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Non-ASCII Characters in Dropbox-API-Arg header #106

Open
ina-yuzen opened this issue Jul 12, 2024 · 0 comments
Open

Handle Non-ASCII Characters in Dropbox-API-Arg header #106

ina-yuzen opened this issue Jul 12, 2024 · 0 comments

Comments

@ina-yuzen
Copy link

When the path contains non-ASCII characters, attempting to upload or download files results in the following error: DropboxApi::Errors::HttpError: HTTP 400.

According to the Dropbox documentation, arguments should be escaped to Unicode escape sequences like \uXXXX:
https://www.dropbox.com/developers/reference/json-encoding

If you use the Dropbox-API-Arg header, you need to make it "HTTP header safe". This means using JSON-style "\uXXXX" escape codes for the character 0x7F and all non-ASCII characters.

Currently, the arguments are sent using JSON.dump(params) in DropboxApi::Endpoints::ContentDownload and DropboxApi::Endpoints::ContentUpload, which does not escape non-ASCII characters. This leads to the HTTP 400 error when non-ASCII characters are present in the path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant