Skip to content

Commit

Permalink
[split] finagle-http: add Response(status)
Browse files Browse the repository at this point in the history
RB_ID=138147
  • Loading branch information
David Helder authored and CI committed Apr 8, 2013
1 parent c64210d commit 921749c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ as it is included in Finagle's user's guide.

6.x
-----
- `finagle-http`: Add Response.apply(status)

6.3.0
~~~~~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,11 @@ abstract class Message extends HttpMessage {

object Message {
private[http] val Utf8 = Charset.forName("UTF-8")
@deprecated("Use MediaType.Json")
@deprecated("Use MediaType.Json", "6.1.5")
val MediaTypeJson = "application/json"
@deprecated("Use MediaType.Javascript")
@deprecated("Use MediaType.Javascript", "6.1.5")
val MediaTypeJavascript = "application/javascript"
@deprecated("Use MediaType.WwwForm")
@deprecated("Use MediaType.WwwForm", "6.1.5")
val MediaTypeWwwForm = "application/x-www-form-urlencoded"
val CharsetUtf8 = "charset=utf-8"
val ContentTypeJson = MediaType.Json + ";" + CharsetUtf8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,18 @@ object Response {
Response(httpResponse)
}

/** Create Response. Convenience method for testing. */
/** Create Response. */
def apply(): Response =
apply(Version.Http11, Status.Ok)

/** Create Response from version and status. Convenience method for testing. */
/** Create Response from version and status. */
def apply(version: HttpVersion, status: HttpResponseStatus): Response =
apply(new DefaultHttpResponse(version, status))

/** Create Response from status. */
def apply(status: HttpResponseStatus): Response =
apply(new DefaultHttpResponse(Version.Http11, status))

/** Create Response from HttpResponse. */
def apply(httpResponseArg: HttpResponse): Response =
new Response {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ trait HttpMessageProxy extends HttpMessage {
def getContent(): ChannelBuffer = httpMessage.getContent()
def setContent(content: ChannelBuffer) { httpMessage.setContent(content) }

@deprecated("deprecated in netty")
@deprecated("deprecated in netty", "6.1.5")
def getContentLength(): Long = httpMessage.getContentLength()
@deprecated("deprecated in netty")
@deprecated("deprecated in netty", "6.1.5")
def getContentLength(defaultValue: Long): Long = httpMessage.getContentLength(defaultValue)

def isChunked: Boolean = httpMessage.isChunked()
def setChunked(chunked: Boolean) { httpMessage.setChunked(chunked) }

@deprecated("deprecated in netty")
@deprecated("deprecated in netty", "6.1.5")
def isKeepAlive: Boolean = httpMessage.isKeepAlive()
}

0 comments on commit 921749c

Please sign in to comment.