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

Parsing fails if part header name contains a number #133

Closed
jhnstrk opened this issue Mar 22, 2024 · 1 comment
Closed

Parsing fails if part header name contains a number #133

jhnstrk opened this issue Mar 22, 2024 · 1 comment

Comments

@jhnstrk
Copy link
Contributor

jhnstrk commented Mar 22, 2024

When custom headers are included in parts, and those header names contain numbers, the multipart parser throws an exception:

Found non-alphanumeric character 49 in header at 92

Numbers are perfectly valid in header names and shouldn't be rejected.

Sample data to reproduce the issue (X-funky-header-1 triggers it):

b'''--b8825ae386be4fdc9644d87e392caad3\r\n
Content-Type: text/plain; charset=utf-8\r\n
X-funky-header-1: bar\r\n
Content-Length: 6\r\n
Content-Disposition: attachment; filename="secret.txt"; name="files"\r\n\r\n
aaaaaa\r\n
--b8825ae386be4fdc9644d87e392caad3--\r\n'''
@Kludex
Copy link
Owner

Kludex commented Apr 18, 2024

@Kludex Kludex closed this as completed Apr 18, 2024
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

No branches or pull requests

2 participants