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

Add strict mode to check for malformed headers (long strings) #50

Merged
merged 2 commits into from
Mar 12, 2024

Conversation

mnapoli
Copy link
Contributor

@mnapoli mnapoli commented Mar 8, 2024

No description provided.

@rcambien
Copy link
Contributor

Thank @mnapoli !

Reading the report I thought the strict mode will focus on the wrong number of newlines but your solution is simpler to detect malformed headers.

I suggest to move the length check directly in the constructor to avoid loading data in memory sooner.

I also check my use cases and I think it's safe to set an hard limit without the strict flag. From what I read, most web server allow a maximum of 8192 characters for an header line, it seem to be a good value for all commun use cases and it will fix the original problem.

Can you update the PR ?

@mnapoli
Copy link
Contributor Author

mnapoli commented Mar 11, 2024

@rcambien thanks, done!

@mnapoli mnapoli force-pushed the long-header-values branch from da15843 to 826ddf9 Compare March 11, 2024 15:19
@rcambien rcambien merged commit 7a9f464 into Riverline:master Mar 12, 2024
8 checks passed
@mnapoli mnapoli deleted the long-header-values branch March 12, 2024 16:52
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