diff --git a/extension/chrome/src/js/stash_page.js b/extension/chrome/src/js/stash_page.js index ae6a93e..f690ffb 100644 --- a/extension/chrome/src/js/stash_page.js +++ b/extension/chrome/src/js/stash_page.js @@ -319,6 +319,15 @@ return ''; } + /** + * Some servers can have an extra relative path. + */ + function getMidPath(){ + var path = location.pathname; + var paths = path.split('/projects/', 2); + return (paths.length > 1) ? paths[0] : ""; + } + /** * Use bitbucket api to search for the user * @param {integer} term name or email of the user to search. @@ -328,7 +337,7 @@ var searchParams = { avatarSize: 32, permission: "LICENSED_USER", start: 0, filter: term }; - jQuery.get( "/rest/api/latest/users", searchParams) + jQuery.get(getMidPath() + "/rest/api/latest/users", searchParams) .done(function( data ) { if (data.values.length > 0) {