-
Notifications
You must be signed in to change notification settings - Fork 3
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/header-timeout: adding ReadTimeout values #39
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how do we determine if these are reasonable values?
what is the existing behavior?
I have the same first question - I'll tag someone else in for a look to see if these could be detrimental. Based on my experience, these values are at the very high end of what an HTTP request should take before it's split up into a job polling pattern. (i.e. if that's the case here, we're going to need a bigger shovel!) Existing behavior is no timeout, thus the potential for a slowloris attack. |
What about something more flexible that the callers can configure themselves, so they aren't stuck with defaults? |
In the context of the threat vector, I see this change as something much more inflexible - i.e. while we could allow clients to configure timeout values that make sense for them, these are the upper bounds for a sensible HTTP request. |
But this code is not sanity checking an upper bound - it is imposing a single constant fixed value. Why is that necessary? What if they want a lower value? |
I don't see any problems setting a default value here, but as Jordan said it would be nice to be configurable with perhaps a sanity check which logs if the provided configuration value is over the default upper bound. It would be pretty easy to add configuration as a For the value itself, it seems rather subjective, but the chosen values seem reasonable. |
It looks like the linter is concerned about |
After thinking about it, I think configurable is the way to go here.
You're right - whether larger or smaller we should leave it up to the library's customers/consumers to set. We can log a warning if it is not set.
It's subjective
I'll double check, but setting ReadTimeout should solve it. Package documentation:
|
51d433a
to
5685628
Compare
5685628
to
a175b7b
Compare
Adding large
ReadTimeout
values to address linting errors.unblocks #38