Skip to content

Commit

Permalink
Merge pull request #74 from taylorleese/master
Browse files Browse the repository at this point in the history
Expose max initial line length and header size
  • Loading branch information
mariusae committed Mar 23, 2012
2 parents 7e23780 + 71c02e7 commit 7c4fb2a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions finagle-http/src/main/scala/com/twitter/finagle/http/Codec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ case class Http(
_decompressionEnabled: Boolean = true,
_channelBufferUsageTracker: Option[ChannelBufferUsageTracker] = None,
_annotateCipherHeader: Option[String] = None,
_enableTracing: Boolean = false)
_enableTracing: Boolean = false,
_maxInitialLineLength: StorageUnit = 4096.bytes,
_maxHeaderSize: StorageUnit = 8192.bytes)
extends CodecFactory[HttpRequest, HttpResponse]
{
def compressionLevel(level: Int) = copy(_compressionLevel = level)
Expand Down Expand Up @@ -142,11 +144,9 @@ case class Http(
}

val maxRequestSizeInBytes = _maxRequestSize.inBytes.toInt
if (maxRequestSizeInBytes < 8192) {
pipeline.addLast("httpCodec", new SafeHttpServerCodec(4096, 8192, maxRequestSizeInBytes))
} else {
pipeline.addLast("httpCodec", new SafeHttpServerCodec(4096, 8192, 8192))
}
val maxInitialLineLengthInBytes = _maxInitialLineLength.inBytes.toInt
val maxHeaderSizeInBytes = _maxHeaderSize.inBytes.toInt
pipeline.addLast("httpCodec", new SafeHttpServerCodec(maxInitialLineLengthInBytes, maxHeaderSizeInBytes, maxRequestSizeInBytes))

if (_compressionLevel > 0) {
pipeline.addLast(
Expand Down

0 comments on commit 7c4fb2a

Please sign in to comment.