Skip to content

Commit

Permalink
Merge branch 'release/0.0.11-1'
Browse files Browse the repository at this point in the history
  • Loading branch information
codahale committed Sep 16, 2011
2 parents 846f5f7 + 20f6598 commit b3a4707
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -6,7 +6,7 @@


<groupId>com.yammer</groupId> <groupId>com.yammer</groupId>
<artifactId>dropwizard_2.9.1</artifactId> <artifactId>dropwizard_2.9.1</artifactId>
<version>0.0.11</version> <version>0.0.11-1</version>
<name>Dropwizard for Scala ${scala.version}</name> <name>Dropwizard for Scala ${scala.version}</name>


<properties> <properties>
Expand Down
Expand Up @@ -24,7 +24,7 @@ object ServerFactory extends Logging {
val server = makeServer(mainConnector, internalConnector) val server = makeServer(mainConnector, internalConnector)


val handlers = new HandlerCollection val handlers = new HandlerCollection
handlers.addHandler(new InstrumentedHandler(servletContext)) handlers.addHandler(servletContext)
handlers.addHandler(internalServletContext) handlers.addHandler(internalServletContext)
if (config("request_log.enabled").or(false)) { if (config("request_log.enabled").or(false)) {
handlers.addHandler(RequestLogHandlerFactory.buildHandler) handlers.addHandler(RequestLogHandlerFactory.buildHandler)
Expand Down Expand Up @@ -102,14 +102,16 @@ object ServerFactory extends Logging {
} }


context.setConnectorNames(Array("main")) context.setConnectorNames(Array("main"))

val instrumented = new InstrumentedHandler(context)
if (config("http.gzip.enabled").or(true)) { if (config("http.gzip.enabled").or(true)) {
val gzip = new GzipHandler(context) val gzip = new GzipHandler(instrumented)
config("http.gzip.min_entity_size_bytes").asOption[Int].foreach(gzip.setMinGzipSize) config("http.gzip.min_entity_size_bytes").asOption[Int].foreach(gzip.setMinGzipSize)
config("http.gzip.buffer_size_kilobytes").asOption[Int].foreach { n => gzip.setBufferSize(n * 1024) } config("http.gzip.buffer_size_kilobytes").asOption[Int].foreach { n => gzip.setBufferSize(n * 1024) }
config("http.gzip.excluded_user_agents").asOption[Set[String]].foreach { s => gzip.setExcluded(s.asJava) } config("http.gzip.excluded_user_agents").asOption[Set[String]].foreach { s => gzip.setExcluded(s.asJava) }
config("http.gzip.mime_types").asOption[Set[String]].foreach {s => gzip.setMimeTypes(s.asJava)} config("http.gzip.mime_types").asOption[Set[String]].foreach {s => gzip.setMimeTypes(s.asJava)}
gzip gzip
} else context } else instrumented
} }


private def internalServletContext(implicit tasks: Set[Task]) = { private def internalServletContext(implicit tasks: Set[Task]) = {
Expand Down

0 comments on commit b3a4707

Please sign in to comment.