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

fix: encode filename when using url prefix for resources #2829

Merged
merged 3 commits into from Jan 24, 2024

Conversation

mudkipme
Copy link
Contributor

Fixes #2828

@boojack
Copy link
Collaborator

boojack commented Jan 24, 2024

@mudkipme
Copy link
Contributor Author

Maybe we can decode it in https://github.com/usememos/memos/blob/main/api/v1/resource.go#L346

Since replacePathTemplate is used by both local storage and S3, encoding filename here will result in percent-encoded filename in local assets folder, which is an unexpected behavior. I also wonder whether S3 SDK or object storage services will double-encoding the '%' character if pass a url-encoded object key.

Copy link
Collaborator

@boojack boojack left a comment

Choose a reason for hiding this comment

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

LGTM

@boojack boojack merged commit f654d3c into usememos:main Jan 24, 2024
5 checks passed
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

Successfully merging this pull request may close these issues.

The externalLink of resources is not URL-encoded when using custom URL prefix for object storage
2 participants