If I put my application in a subdirectory, e.g. by naming it cm.war, after a successful login the redirect goes to /cm/cm (should be /cm).
I don't believe I have done anything funny in the boot code,
val loggedIn = If(() => User.loggedIn_?, () => RedirectResponse(开发者_如何学运维User.loginPageURL))
val loggedInSU = If(() => User.superUser_?, () => RedirectResponse(User.loginPageURL))
some menu code
, (Menu("Users") / "users" / "index" >> loggedInSU) submenus (userSubMenus)
later I am applying the User.sitemapMutator
Other redirects in the app works fine.
Stepping the code reveals that it indeed tries to redirect to / which gets transformed into /cm by the updateWithContextPath in the Req class. It could be that updateWithContextPath for some reason is called twice, but I have not been able to see that in the debugger.
It works well as long as I deploy the app as root.
I am using lift 2.4-M3 and have tried both jetty 7.4.5 and 6.1.24.
Does anyone have an idea of what's happening?
edit Some more stepping reveals that the response actually looks alright, but it get's transformed in LiftServlet, fixHeaders, from /cm to /cm/cm.
Bug?
Yes, this is a known bug in 2.4-M3, see here: https://www.assembla.com/spaces/liftweb/tickets/1082-redirectresponse-duplicates-contextpath
精彩评论