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

properly encode document filename in url #1744

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

upsuper
Copy link
Contributor

@upsuper upsuper commented Jan 26, 2024

When filename contains certain special characters like #, the URL would not be getting the right file. For example, if the document file is /home/upsuper/beancount/receipt #1.pdf, the URL would be /document/?filename=/home/upsuper/beancount/receipt #1.pdf whose meaning is requesting /document/?filename=/home/upsuper/beancount/receipt and use the fragment 1.pdf, which is wrong.

This PR makes it encode the filename as a URL component so that it would work regardless of characters used in the document filename.

Copy link
Member

@yagebu yagebu left a comment

Choose a reason for hiding this comment

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

Thanks for the fix :)

@yagebu yagebu merged commit 5e07a47 into beancount:main Feb 2, 2024
18 checks passed
@upsuper upsuper deleted the document-filename-encode branch February 2, 2024 19:53
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.

2 participants