Skip to content

Commit

Permalink
PR for #512 Feature request: needed more control over netty configura…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
Takeharu Oshida committed Feb 10, 2015
1 parent 466588d commit 32b3503
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Expand Up @@ -7,6 +7,8 @@
* `#508 <https://github.com/xitrum-framework/xitrum/issues/508>`_
Respond 400 Bad Request when params in request URI or body can't be decoded,
not just closing the connection
* `#512 <https://github.com/xitrum-framework/xitrum/issues/512>`_
Feature request: needed more control over netty configuration
* `#511 <https://github.com/xitrum-framework/xitrum/issues/511>`_
Update RhinoCoffeeScript from 1.8.0 to 1.9.0

Expand Down
3 changes: 2 additions & 1 deletion src/main/scala/xitrum/Config.scala
Expand Up @@ -120,7 +120,8 @@ class StaticFileConfig(config: TConfig) {
class RequestConfig(config: TConfig) {
val charsetName = config.getString("charset")
val charset = Charset.forName(charsetName)
val maxInitialLineLength = config.getInt("maxInitialLineLength")
val maxInitialLineLength = if (config.hasPath("maxInitialLineLength")) config.getInt("maxInitialLineLength") else 4096
val maxHeaderSize = if (config.hasPath("maxHeaderSize")) config.getInt("maxHeaderSize") else 8192
val maxSizeInBytes = config.getLong("maxSizeInMB") * 1024 * 1024
val maxSizeInBytesOfUploadMem =
if (config.hasPath("maxSizeInKBOfUploadMem"))
Expand Down
Expand Up @@ -114,7 +114,10 @@ class DefaultHttpChannelInitializer extends ChannelInitializer[SocketChannel] {

if (portConfig.flashSocketPolicy.isDefined && portConfig.flashSocketPolicy == portConfig.http)
p.addLast(classOf[FlashSocketPolicyHandler].getName, new FlashSocketPolicyHandler)
p.addLast(classOf[HttpRequestDecoder].getName, new HttpRequestDecoder(Config.xitrum.request.maxInitialLineLength, 8192, 8192))
p.addLast(classOf[HttpRequestDecoder].getName, new HttpRequestDecoder(
Config.xitrum.request.maxInitialLineLength,
Config.xitrum.request.maxHeaderSize,
8192))
p.addLast(classOf[Request2Env].getName, new Request2Env)
p.addLast(classOf[BaseUrlRemover].getName, baseUrlRemover)
if (Config.xitrum.basicAuth.isDefined)
Expand Down

0 comments on commit 32b3503

Please sign in to comment.