You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
I write corporate web apps that need to be accessible via our SSL VPN. In particular we have a Juniper appliance, and it handles secure proxying of the app. The issue is that it adds a bunch of extra stuff to the URL and this causes Angular routes to fail since the extra stuff is random in nature (session ids, etc). I've found the easiest way to deal with this is to patch the parseAppUrl function in angular.js.
This doesn't make sense to include in the core Angular library since it's Juniper SSL VPN specific, but I wanted to post it for anyone struggling with similar URL re-write issues from external appliances. Though perhaps a better fix would be to provide a hook into the parseAppUrl method, to allow a user to configure some external processing of the locationObj prior to parseAppUrl returning.
functionparseAppUrl(relativeUrl,locationObj,appBase){varprefixed=(relativeUrl.charAt(0)!=='/');if(prefixed){relativeUrl='/'+relativeUrl;}varmatch=urlResolve(relativeUrl,appBase);locationObj.$$path=decodeURIComponent(prefixed&&match.pathname.charAt(0)==='/' ?
match.pathname.substring(1) : match.pathname);locationObj.$$search=parseKeyValue(match.search);locationObj.$$hash=decodeURIComponent(match.hash);//Detect Juniper re-write functions and handle the $$path issueif(locationObj.$$path==="[object Object]"&&typeof(DanaOrigUrl)==='function'){var__strH='href';var__tmpHack=match[__strH];var__nn=(""+__tmpHack).match(/^(https?:\/\/[^\/]+)?([^?|#]*)/);locationObj.$$path=__nn[2];}// make sure path starts with '/';if(locationObj.$$path&&locationObj.$$path.charAt(0)!='/'){locationObj.$$path='/'+locationObj.$$path;}}