-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User session constructor strips the trailing slash of the provided URL #1073
Comments
@arozniak could you provide a reproduction case where this breaks? You can email me internally if you want. We agreed at the start of the ArcGIS REST JS project to normalize URLs to not contain a trailing |
Here is a minimal test case: import { ArcGISIdentityManager } from '@esri/arcgis-rest-request';
import { createFeatureService } from '@esri/arcgis-rest-feature-service';
import { getServiceAdminInfo from '@esri/arcgis-rest-feature-service';
const token = ""; //... user provided auth token ..
const clientId = 'arcgisUrban';
const portalUrl = 'https://zrh-urb-arc01.esri.com/portal/'; // or another ArcGIS Enteprise portal URL
const EDIT_CAPABILITIES = 'Query,Create,Update,Delete,Editing';
const AGO_DEFAULT_MAX_RECORD_COUNT = 50_000;
const userSession = new ArcGISIdentityManager({
portal: portalUrl,
clientId,
token,
});
const createFeatureServiceResult = await createFeatureService({
...baseQueryOptions,
item: {
name: "Some Name",
capabilities: EDIT_CAPABILITIES,
hasStaticData: false,
maxRecordCount: AGO_DEFAULT_MAX_RECORD_COUNT,
spatialReference: { wkid: CoordinateSystem.WebMercator },
},
folderId: '/',
});
// it fails on this call
const { adminServiceInfo } = await getServiceAdminInfo(createBaseFeatureServiceResult.serviceurl, userSession); To make the above work, this must be added to modify the const session = userSession as any;
session.portal += '/'; |
@arozniak @aseigo can you send me some user credentials for that Enterprise installation so I can test the reproduction case? Looking at this I don't see anything out of order. We determine the admin URL in
Can you also send me a |
Done; I've sent the info by email to keep account and other info off of here :) |
Describe the bug
The user session constructor strips the trailing slash of the provided URL.
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:
Is this an expected behavior?
cc @sandromartis
Reproduction
see above
Logs
No response
System Info
Additional Information
No response
The text was updated successfully, but these errors were encountered: