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

LIVY-358. Make JettyServer Http request and response header size configurable #329

Merged
merged 2 commits into from
May 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions server/src/main/scala/com/cloudera/livy/LivyConf.scala
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,14 @@ object LivyConf {

val SERVER_HOST = Entry("livy.server.host", "0.0.0.0")
val SERVER_PORT = Entry("livy.server.port", 8998)
val CSRF_PROTECTION = LivyConf.Entry("livy.server.csrf-protection.enabled", false)

val UI_ENABLED = Entry("livy.ui.enabled", true)

val REQUEST_HEADER_SIZE = Entry("livy.server.request-header.size", 131072)
val RESPONSE_HEADER_SIZE = Entry("livy.server.response-header.size", 131072)

val CSRF_PROTECTION = Entry("livy.server.csrf-protection.enabled", false)

val IMPERSONATION_ENABLED = Entry("livy.impersonation.enabled", false)
val SUPERUSERS = Entry("livy.superusers", null)

Expand All @@ -83,14 +87,10 @@ object LivyConf {

val HEARTBEAT_WATCHDOG_INTERVAL = Entry("livy.server.heartbeat-watchdog.interval", "1m")

val LAUNCH_KERBEROS_PRINCIPAL =
LivyConf.Entry("livy.server.launch.kerberos.principal", null)
val LAUNCH_KERBEROS_KEYTAB =
LivyConf.Entry("livy.server.launch.kerberos.keytab", null)
val LAUNCH_KERBEROS_REFRESH_INTERVAL =
LivyConf.Entry("livy.server.launch.kerberos.refresh-interval", "1h")
val KINIT_FAIL_THRESHOLD =
LivyConf.Entry("livy.server.launch.kerberos.kinit-fail-threshold", 5)
val LAUNCH_KERBEROS_PRINCIPAL = Entry("livy.server.launch.kerberos.principal", null)
val LAUNCH_KERBEROS_KEYTAB = Entry("livy.server.launch.kerberos.keytab", null)
val LAUNCH_KERBEROS_REFRESH_INTERVAL = Entry("livy.server.launch.kerberos.refresh-interval", "1h")
val KINIT_FAIL_THRESHOLD = Entry("livy.server.launch.kerberos.kinit-fail-threshold", 5)

/**
* Recovery mode of Livy. Possible values:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,15 @@ class WebServer(livyConf: LivyConf, var host: String, var port: Int) extends Log

val (connector, protocol) = Option(livyConf.get(LivyConf.SSL_KEYSTORE)) match {
case None =>
(new ServerConnector(server), "http")
val http = new HttpConfiguration()
http.setRequestHeaderSize(livyConf.getInt(LivyConf.REQUEST_HEADER_SIZE))
http.setResponseHeaderSize(livyConf.getInt(LivyConf.RESPONSE_HEADER_SIZE))
(new ServerConnector(server, new HttpConnectionFactory(http)), "http")

case Some(keystore) =>
val https = new HttpConfiguration()
https.setRequestHeaderSize(livyConf.getInt(LivyConf.REQUEST_HEADER_SIZE))
https.setResponseHeaderSize(livyConf.getInt(LivyConf.RESPONSE_HEADER_SIZE))
https.addCustomizer(new SecureRequestCustomizer())

val sslContextFactory = new SslContextFactory()
Expand Down