Skip to content

Commit

Permalink
Merge pull request #582 from kenlyon/fix/improve-discovery-of-server-…
Browse files Browse the repository at this point in the history
…root

Improve discovery of server root when url is for "services" endpoint.
  • Loading branch information
tomwayson authored Jun 14, 2019
2 parents 4d2975a + 39c11ef commit eabfb14
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 @@ -781,7 +781,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] = url.split(/\/rest(\/admin)?\/services(?:\/|#|\?|$)/);
const [match, protocol, domainAndPath] = root.match(/(https?:\/\/)(.+)/);
const [domain, ...path] = domainAndPath.split("/");

Expand Down

0 comments on commit eabfb14

Please sign in to comment.