Skip to content

Commit

Permalink
Use full request method URL if contains http or https.
Browse files Browse the repository at this point in the history
  • Loading branch information
PabloVallejo committed Apr 6, 2014
1 parent 2ca1777 commit 30853e5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions gillie.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,11 @@
return optional ? match : modelVar || match;
});

return this.url ? this.url + route :
window.location.href + '/' + route;
// Use `route` as full URL if its contains
// `http:|https:`.
return (/^(\/\/|http:|https:).*/.test( route )) ?
route : ( this.url ? this.url + route :
window.location.href + '/' + route );

}

Expand Down Expand Up @@ -511,4 +514,4 @@
// Expose Gillie to the global scope
window.Gillie = Gillie;

})( jQuery, this );
})( jQuery, this );
2 changes: 1 addition & 1 deletion gillie.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 30853e5

Please sign in to comment.