Better handling of context and allow Lift apps to have context modified on a session-by-session basis
Support for changing the context root for requests so the root can be blank even if the actual context path is not or that a context path can be added (and all requests will be rewritten removing that context path from the head of the path) or subtracted.
Leave a comment
on 2010-02-06 19:48 *
By github.importer
Imported from GitHub: http://github.com/dpp/liftweb/issues/68/find
I'm currently replacing net.liftweb.http.Req.fixHref in boot in order to work around a similar issue (removing both context root and one level of template subdirectory, for multiple subdomains on a single lift app). Basically, our boot looks like
where customLink does potentially arbitrary munging on a per-request basis, in our case using headers from the frontend proxy to figure out which subdomain is being accessed and generate relative or absolute links appropriately.
I'd ask that the solution for this ticket either leave Req.fixHref publicly accessible, or replace it with a similarly flexible alternative.
def boot {
...
net.liftweb.http.Req.fixHref = fixHref _
}
private def fixHref(contextPath: String, v: Seq[Node], fixURL: Boolean, rewrite: Box[String => String]): Text = {
val s = v.text
Text(if (s.startsWith("http")) s else customLink(s, false).openOr(Text("/")).toString)
}
where customLink does potentially arbitrary munging on a per-request basis, in our case using headers from the frontend proxy to figure out which subdomain is being accessed and generate relative or absolute links appropriately.
I'd ask that the solution for this ticket either leave Req.fixHref publicly accessible, or replace it with a similarly flexible alternative.