Skip to content

chore(s3): encode url for returning public url#602

Open
purerosefallen wants to merge 1 commit intomasterfrom
s3-fix-downloadurl
Open

chore(s3): encode url for returning public url#602
purerosefallen wants to merge 1 commit intomasterfrom
s3-fix-downloadurl

Conversation

@purerosefallen
Copy link
Member

S3 provides public assets with encoded filename. it should be encoded here.

const { buffer, filename } = await this.analyze(url, file)
const s3Key = `${this.config.pathPrefix}${filename}`
const finalUrl = `${this.config.publicUrl}${filename}`
const finalUrl = `${this.config.publicUrl}${encodeURIComponent(filename)}`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is slash expected as a suffix for publicUrl?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is designed to match the same behavior as pathPrefix.

@shigma shigma force-pushed the master branch 3 times, most recently from a13f0aa to 8cb4069 Compare May 3, 2022 16:08
@shigma shigma force-pushed the master branch 13 times, most recently from a6380b3 to d2d815c Compare November 26, 2023 08:09
@shigma shigma force-pushed the master branch 2 times, most recently from e08f6e0 to 78d105d Compare December 6, 2023 15:47
@shigma shigma force-pushed the master branch 5 times, most recently from 9d729d2 to 16d5f58 Compare December 27, 2025 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants