Skip to content

Commit

Permalink
Ensures S.setHeader works in stateless requests
Browse files Browse the repository at this point in the history
  • Loading branch information
dpp committed May 23, 2011
1 parent 2bf60d3 commit c6cafb6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions web/webkit/src/main/scala/net/liftweb/http/LiftServlet.scala
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ class LiftServlet extends Loggable {
* Service the HTTP request
*/
def doService(req: Req, response: HTTPResponse): Boolean = {
var tmpStatelessHolder: Box[() => Box[LiftResponse]] = null
var tmpStatelessHolder: Box[Box[LiftResponse]] = Empty

tryo {
LiftRules.onBeginServicing.toList.foreach(_(req))
Expand Down Expand Up @@ -253,12 +253,15 @@ class LiftServlet extends Loggable {
// if the request is matched is defined in the stateless table, dispatch
if (S.statelessInit(req) {
tmpStatelessHolder = NamedPF.applyBox(req,
LiftRules.statelessDispatchTable.toList);
LiftRules.statelessDispatchTable.toList).map(_.apply() match {
case Full(a) => Full(LiftRules.convertResponse((a, Nil, S.responseCookies, req)))
case r => r
});
tmpStatelessHolder.isDefined
}) {
val f = tmpStatelessHolder.open_!
f() match {
case Full(v) => Full(LiftRules.convertResponse((v, Nil, S.responseCookies, req)))
f match {
case Full(v) => Full(v)
case Empty => LiftRules.notFoundOrIgnore(req, Empty)
case f: Failure => Full(req.createNotFound(f))
}
Expand Down

0 comments on commit c6cafb6

Please sign in to comment.