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: Decode field names and filenames correctly #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

defnull
Copy link
Owner

@defnull defnull commented Oct 17, 2024

See #60

Question 1: The new content_disposition_[un]quote() functions have a really long name. Any better ideas? I wanted to distinguish those from the old header_[un]quote() functions.

Question 2: We don't use the old quoting functions anymore, but others do. Keep them?
Answer: Yes we use the old functions for all other headers (e.g. content-type). Do not deprecate them.

@defnull defnull added the Discussion Needs feedback label Oct 17, 2024
@defnull defnull force-pushed the fix-60 branch 6 times, most recently from 90b3d1f to babed4d Compare October 18, 2024 19:32
The HTML5 specification defines that "field names and filenames for file fields [...] must be escaped by replacing any 0x0A (LF) bytes with the byte sequence %0A, 0x0D (CR) with %0D and 0x22 (") with %22. The user agent must not perform any other escapes." and tests show that modern browsers actually do that. This is different from traditional header quoting (which involves backslash-escaping quotes and backslashes).

fixes #60
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Needs feedback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant