Skip to content

Commit

Permalink
Change sendStatus method name to sendRequestTooLongResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
Rudrani committed Aug 28, 2019
1 parent 1ce626b commit 2613958
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Sources/KituraNet/HTTP/HTTPRequestHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ internal class HTTPRequestHandler: ChannelInboundHandler, RemovableChannelHandle
let contentLength = header.headers["Content-Length"].first,
let contentLengthValue = Int(contentLength) {
if contentLengthValue > requestSizeLimit {
sendStatus(context: context)
sendRequestTooLongResponse(context: context)
context.close()
}
}
serverRequest = HTTPServerRequest(channel: context.channel, requestHead: header, enableSSL: enableSSLVerification)
Expand Down Expand Up @@ -159,7 +160,7 @@ internal class HTTPRequestHandler: ChannelInboundHandler, RemovableChannelHandle
keepAliveState.decrement()
}

func sendStatus(context: ChannelHandlerContext) {
func sendRequestTooLongResponse(context: ChannelHandlerContext) {
let statusDescription = HTTP.statusCodes[HTTPStatusCode.requestTooLong.rawValue] ?? ""
do {
serverResponse = HTTPServerResponse(channel: context.channel, handler: self)
Expand Down

0 comments on commit 2613958

Please sign in to comment.