Skip to content

Returning wrong file name #140

@danielsanfr

Description

@danielsanfr

Assuming the following configuration:

new ParseServer({
    preserveFileName: true,
    filesAdapter: {
        module: '@parse/s3-files-adapter'.
        options: {
            directAccess: false,
            validateFilename(filename: string) { return null }
        }
})

And that it has a file saved with the following name: folder/bar-bar.jpg.

When I retrieve the file URL, the getFileLocation function returns: https://<MOUNT_PATH>/files/<APP_ID>/folder/bar-bar.jpg. However, this URL causes the parse-server to return an error: HTTP 403 - {"error":"unauthorized"}

The correct URL that should be returned is: https://<MOUNT_PATH>/files/<APP_ID>/folder%2Fbar-bar.jpg

I would like to know how you would like to solve this problem? Since the response may behave differently when directAccess is true or false.

Note: I encountered this problem while doing some tests with my PR #117.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions