Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

As discussed a while back, S.location is stored in a RequestVar and i…

…f the value was accessed before request state had been initialized it wasn't being retried. This will check repeatedly, but only if the RequestVar does not already hold a Full value.
  • Loading branch information...
commit 598fb03518ece48e817c61d089881fce6f23c1dd 1 parent 9c53f7e
@davewhittaker davewhittaker authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 web/webkit/src/main/scala/net/liftweb/http/S.scala
View
5 web/webkit/src/main/scala/net/liftweb/http/S.scala
@@ -386,7 +386,10 @@ trait S extends HasParams with Loggable {
private[http] object CurrentLocation extends RequestVar[Box[sitemap.Loc[_]]](request.flatMap(_.location))
- def location: Box[sitemap.Loc[_]] = CurrentLocation.is
+ def location: Box[sitemap.Loc[_]] = CurrentLocation.is or {
+ //try again in case CurrentLocation was accessed before the request was available
+ request flatMap { r => CurrentLocation(r.location) }
+ }
/**
Please sign in to comment.
Something went wrong with that request. Please try again.