Skip to content

Empty transform object routes to wrong endpoint in download() and getPublicUrl() #2218

@oniani1

Description

@oniani1

PR #2162 fixed createSignedUrl() to properly handle empty transform objects, but the same bug is still present in download() and getPublicUrl().

Both methods use typeof options?.transform !== 'undefined' to decide whether to route through /render/image/. Since typeof {} !== 'undefined' is true, passing { transform: {} } incorrectly routes to the image render endpoint, which returns 422 for non-image files.

createSignedUrl now correctly checks:

typeof options?.transform === 'object' && options.transform !== null && Object.keys(options.transform).length > 0

download and getPublicUrl should use the same pattern.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions