Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Listing 3.6: A Complex Rewrite Example #40

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

Listing 3.6: A Complex Rewrite Example #40

rcannood opened this issue Jan 8, 2011 · 3 comments

Comments

@rcannood
Copy link

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)
@dchenbecker
Copy link
Collaborator

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)

@rcannood
Copy link
Author

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))

@dchenbecker
Copy link
Collaborator

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants