arcgis-rest-js icon indicating copy to clipboard operation
arcgis-rest-js copied to clipboard

User session constructor strips the trailing slash of the provided URL

Open arozniak opened this issue 1 year ago • 4 comments

Describe the bug

The user session constructor strips the trailing slash of the provided URL.

import {ArcGISIdentityManager} from '@esri/arcgis-rest-request';

  const userSession = new ArcGISIdentityManager({
    portal: portalUrl,
    clientId,
    token,
  });

Since we need a portal URL with a trailing slash at the end (for the Enterprise implementation), we need to add the following hack to the code:

  const session = userSession as any;
  session.portal += '/';

Is this an expected behavior?

cc @sandromartis

Reproduction

see above

Logs

No response

System Info

"@esri/arcgis-rest-request": "^4.0.3"

Additional Information

No response

arozniak avatar Jan 20 '23 14:01 arozniak