Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
fix(location): correctly rewrite Html5 urls
Browse files Browse the repository at this point in the history
  • Loading branch information
petebacondarwin committed Apr 25, 2013
1 parent 0fbf584 commit 77ff108
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ng/location.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,14 @@ function LocationHtml5Url(appBase, basePrefix) {
};

this.$$rewrite = function(url) {
var appUrl;
var appUrl, prevAppUrl;

if ( (appUrl = beginsWith(appBase, url)) !== undefined ) {
prevAppUrl = appUrl;
if ( (appUrl = beginsWith(basePrefix, appUrl)) !== undefined ) {
return appBaseNoFile + (beginsWith('/', appUrl) || appUrl);
} else {
return appBase;
return appBase + prevAppUrl;
}
} else if ( (appUrl = beginsWith(appBaseNoFile, url)) ) {
return appBaseNoFile + appUrl;
Expand Down

0 comments on commit 77ff108

Please sign in to comment.