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

Merged
merged 2 commits into from
Nov 16, 2024
Merged

fix: Decode field names and filenames correctly #61

merged 2 commits into from
Nov 16, 2024

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 7 times, most recently from babed4d to 8ee7f0e Compare October 18, 2024 19:45
@defnull defnull requested a review from cjwatson October 23, 2024 17:01
The WHATWG 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
@defnull defnull merged commit e8382fc into master Nov 16, 2024
10 checks passed
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