# HG changeset patch # User Tomas Zeman # Date 1287748559 -7200 # Node ID 824fbbce8e65315daf89aae726f7da8e727ea187 # Parent 5ef63a5d98b2a41381f55889f05ef123ba737970 scala/lift/Boot.scala: useful rules (utf8, end/ fix) diff -r 5ef63a5d98b2 -r 824fbbce8e65 scala/lift/Boot.scala --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scala/lift/Boot.scala Fri Oct 22 13:55:59 2010 +0200 @@ -0,0 +1,22 @@ +/* additions to Boot.scala */ + +class Boot extends Logger { + + def boot = { + ... + + /* Handle end slash and drop it (except for home page) */ + LiftRules.statelessRewrite.append { + case RewriteRequest(ParsePath(xs,_,_,true),_,_) if (xs.size > 1) && + (xs.lastOption == Some("index")) => + RewriteResponse(xs dropRight 1) + } + + /* Http conf */ + LiftRules.logServiceRequestTiming = false + LiftRules.early.append(_.setCharacterEncoding("UTF-8")) + + } +} + +// vim: set ts=2 sw=2 et: