-
-
Notifications
You must be signed in to change notification settings - Fork 15
Customize maximum line length constraint #41
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
Comments
That would be an acceptable PR. Another option might be increase the default to 16KiB? Maybe 8KiB is too conservative? You may also be able to write this: require "protocol/http1/connection"
Protocol::HTTP1::DEFAULT_MAXIMUM_LINE_LENGTH = 16384 |
16KiB would definitely work for us, more than that our load balancer just rejects the request with a "414 Request-URI Too Large". But I understand that our use case is very peculiar, I'm not sure if it's worth changing the default for everyone. Also, re-assigning |
@ioquatix thanks for the help! Feel free to close the issue. |
Okay, there is now an official way to do this, using the latest # falcon.rb
service "hello.localhost" do
include Falcon::Environment::SelfSignedTLS
include Falcon::Environment::Rack
protocol {Async::HTTP::Protocol::HTTP1.new(
maximum_line_length: 1024*16
)}
# ... rest of configuration Similar example code is included here: socketry/falcon@55b8bab See socketry/async-http#198 for the pull request that addressed this issue. |
@ioquatix excellent work, thank you so much! |
Hi there!
We have a server running on Falcon that uses a GET endpoint to handle large JSON payloads (due to some old integrations, switching to a POST endpoint isn't an option for now).
After updating to protocol-http1 v0.28.0 (via async-http v0.82.0), we started noticing that some requests were being dropped with the following error:
We understand the security considerations behind this constraint, but we need to accept requests longer than 8192 bytes (at least up to 16kb).
For now, we’ve reverted to
protocol-http1
v0.27.0 to remove the request size constraint, but it would be great if this constraint was customizable.One possible solution could be introducing an environment variable, like
PROTOCOL_HTTP1_MAXIMUM_LINE_LENGTH
, to override the default:I'd be happy to put together a PR if this sounds like a reasonable approach.
The text was updated successfully, but these errors were encountered: