Skip to content

Commit

Permalink
fix proxy chunked / non chunked
Browse files Browse the repository at this point in the history
  • Loading branch information
sclasen committed Nov 21, 2013
1 parent a615f64 commit f1ccd14
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/main/scala/com/heroku/play/api/libs/ws/WSProxy.scala
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,15 @@ object WSProxy extends Controller {
// depending on whether you have a content length, you may need to apply the Results.chunked enumeratee and add chunked headers to the result here.
val headers = responseHeader.headers.map {
case (k, v) => k -> v.head
}.toSeq
result.trySuccess(Status(responseHeader.status).stream(enumerator).withHeaders(headers: _*))
}
result.trySuccess {
responseHeader.headers.get("Content-Length").map {
_ =>
SimpleResult(ResponseHeader(responseHeader.status, headers), enumerator)
}.getOrElse {
Status(responseHeader.status).stream(enumerator).withHeaders(headers.toSeq: _*)
}
}
iteratee
}.recover {
case _ =>
Expand Down

0 comments on commit f1ccd14

Please sign in to comment.