Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Better handling of context and allow Lift apps to have context modified on a session-by-session basis #68

Closed
dpp opened this Issue · 5 comments

5 participants

@dpp
Owner

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.

@nafg

Updating tickets (#68, #95, #257, #287, #312, #326)

@koeninger

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

 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.

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.