Skip to content

Commit

Permalink
Ignore trailing slashes in server url (#605)
Browse files Browse the repository at this point in the history
Prevent issues with authenticating with standalone server url's that contain trailing slashes
  • Loading branch information
green3g authored and patrickarlt committed Aug 7, 2019
1 parent 8650199 commit 1635eb2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/arcgis-rest-auth/src/UserSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ export class UserSession implements IAuthenticationManager {
* @param url the URl to determine the root url for.
*/
public getServerRootUrl(url: string) {
const [root] = url.split(/\/rest(\/admin)?\/services(?:\/|#|\?|$)/);
const [root] = cleanUrl(url).split(/\/rest(\/admin)?\/services(?:\/|#|\?|$)/);
const [match, protocol, domainAndPath] = root.match(/(https?:\/\/)(.+)/);
const [domain, ...path] = domainAndPath.split("/");

Expand Down

0 comments on commit 1635eb2

Please sign in to comment.