Skip to content

Sample code of URL rewrite has compilation error. #35

Closed
xiaowl opened this Issue Dec 15, 2010 · 1 comment

2 participants

@xiaowl
xiaowl commented Dec 15, 2010

In sec 3.7 code list 3.6, A Complex Rewrite Example, there is a val declaration,
val rewriter = {
case RewriteRequest(ParsePath(username :: Nil, _, _, _),
DeleteRequest,
httpreq)
if isMgmtSubnet(httpreq.getRemoteHost()) =>
RewriteResponse(deleteUser :: Nil, Map(username -> username))
}
The Scala compiler will compile the case statement to a Functionk or PartialFunction object, but if you don't specify the val type, there should be a compilation error. I think it should be,
val rewriter:PartialFunction[RewriteRequest,RewriteResponse] = {...}
My Scala version is 2.8.1.final.
This book is great, thanks for your work :-)
Thanks,
Kevin Xiao

@dchenbecker
Collaborator

Updated broken rewrite example listing

Closed by 26ddae7

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.