Skip to content

File upload fails when filename contains non-ASCII characters #226

@modestman

Description

@modestman

When using StoragesResource.add_storage(file) to upload a file with Cyrillic characters in its name, the upload fails.

According to the API documentation, the filename is passed in the Crowdin-API-FileName HTTP header and must be URL-encoded.

However, in crowdin_api/requester.py (line 116), URL encoding is not applied:

headers["Crowdin-API-FileName"] = os.path.basename(file.name)

Expected behavior:

from urllib.parse import quote
headers["Crowdin-API-FileName"] = quote(os.path.basename(file.name))

Could you please fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions