Skip to content

Commit

Permalink
Delimit version in GUID string by a dash.
Browse files Browse the repository at this point in the history
Before we were relying on the expected length of the funcName,
determined by calling nextFuncName. Because funcName isn't *always* the
same length, we switch instead ot putting a - between the GUID and the
version identifier in the path. We then look for it when extracting the
version identifier.
  • Loading branch information
Shadowfiend committed Aug 18, 2012
1 parent ba0b313 commit 1c46530
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions web/webkit/src/main/scala/net/liftweb/http/LiftServlet.scala
Expand Up @@ -418,11 +418,11 @@ class LiftServlet extends Loggable {

private object AjaxVersions {
def unapply(ajaxPathPart: String) : Option[(String,Int)] = {
val funcLength = Helpers.nextFuncName.length
if (ajaxPathPart.length > funcLength)
val dash = ajaxPathPart.indexOf("-")
if (dash > -1 && ajaxPathPart.length > dash + 1)
Some(
(ajaxPathPart.substring(0, funcLength),
ajaxPathPart.charAt(funcLength))
(ajaxPathPart.substring(0, dash),
ajaxPathPart.charAt(dash + 1))
)
else
None
Expand Down
Expand Up @@ -186,7 +186,7 @@ object ScriptRenderer {
addPageNameAndVersion: function(url) {
return """ + {
if (LiftRules.enableLiftGC) {
"url.replace('" + LiftRules.ajaxPath + "', '" + LiftRules.ajaxPath + "/'+lift_page+(liftAjax.lift_ajaxVersion % 36).toString(36));"
"url.replace('" + LiftRules.ajaxPath + "', '" + LiftRules.ajaxPath + "/'+lift_page+('-'+liftAjax.lift_ajaxVersion%36).toString(36));"
} else {
"url;"
}
Expand Down

0 comments on commit 1c46530

Please sign in to comment.