Listing 3.6: A Complex Rewrite Example #40

Closed
rcannood opened this Issue Jan 8, 2011 · 3 comments

Comments

Projects
None yet
2 participants

rcannood commented Jan 8, 2011

In Listing 3.6, A Complex Rewrite Example:

val rewriter : PartialFunction[RewriteRequest,RewriteResponse] = {
  case RewriteRequest(ParsePath(username :: Nil, _, _, _),
      DeleteRequest,
      httpreq)
      if isMgmtSubnet(httpreq.getRemoteHost()) =>
    RewriteResponse(deleteUser :: Nil, Map(username -> username))
}
LiftRules.rewrite.append(rewriter)

Should probably be:

val rewriter : PartialFunction[RewriteRequest,RewriteResponse] = {
  case RewriteRequest(ParsePath("username" :: Nil, _, _, _),
      DeleteRequest,
      httpreq)
      if isMgmtSubnet(httpreq.getRemoteHost()) =>
    RewriteResponse("deleteUser" :: Nil, Map("username" -> username))
}
LiftRules.rewrite.append(rewriter)
Collaborator

dchenbecker commented Jan 16, 2011

Added Designer-Friendly and CSS info

Closed by e48ff78 (CSS transforms)
Closed by e48ff78 (DFT)
Closed by e48ff78 (minor fixes to XMPP section wording)
Closed by e48ff78 (minor fix to rewrite example)

Halfway there :)

In Listing 3.6, A Complex Rewrite Example, the following still needs to be changed:

case RewriteRequest(ParsePath(username :: Nil, _, _, _),

to
case RewriteRequest(ParsePath("username" :: Nil, _, _, _),

and

RewriteResponse(deleteUser :: Nil, Map("username" -> username))

to
RewriteResponse("deleteUser" :: Nil, Map("username" -> username))

Collaborator

dchenbecker commented Feb 1, 2011

Closed in 6a25dd0

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment