-
Notifications
You must be signed in to change notification settings - Fork 787
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
Allow For Providing HttpConfiguration With Jetty #4032
Allow For Providing HttpConfiguration With Jetty #4032
Conversation
This commit makes two meaningful changes, * Allow for the user to provide their own `HttpConfiguration` value. This is important as there are many settings which are not modeled in the `JettyBuilder` that one would general expect to have access to. * Enforces that the `HttpConfiguration` is used whether or not http2 is enabled. Formerly the `HttpConfiguration` was only used if there was not an `SslConnectionFactory` and http2 support was enabled.
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.
I like it.
I've thought it would be nice to provide an alternate builder that just took a Jetty instance and wrapped it in the typical server trappings. This would allow the more exotic parts of the API our builder doesn't cover. But I think this is good for what we do today.
@@ -400,6 +444,10 @@ object JettyBuilder { | |||
case SSLClientAuthMode.Required => | |||
sslContextFactory.setNeedClientAuth(true) | |||
} | |||
|
|||
/** The default [[org.eclipse.jetty.server.HttpConfiguration]] to use with jetty. */ | |||
val defaultJettyHttpConfiguration: HttpConfiguration = |
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.
Does this need to be public? I guess we're already committed to supporting anHttpConfiguration
on the API, so the additional liability isn't much. I could go either way here.
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.
@rossabaker I made it public so that someone who wants to make a minor adjustment to the configuration can do so and then just use the rest of the "default" http4s configuration. Of course, since our default configuration right now is just the empty constructor, that doesn't really make a lot of sense.
I am going to make another PR which attempts to align the various configuration parameters which can be meaningfully shared between server backends, e.g. request header size etc. I'll make this private until that PR.
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.
@rossabaker updated
This commit makes two meaningful changes,
HttpConfiguration
value. This is important as there are many settings which are not modeled in theJettyBuilder
that one would general expect to have access to.HttpConfiguration
is used whether or not http2 is enabled. Formerly theHttpConfiguration
was only used if there was not anSslConnectionFactory
and http2 support was enabled.