From 7e3d9f621ced27e3a64778ebbebff40fcc93d994 Mon Sep 17 00:00:00 2001 From: Tom Wayson Date: Thu, 12 Jul 2018 07:47:21 -0700 Subject: [PATCH] fix(users): users defaults to https://www.arcgis.com instead of http:// always use HTTPS AFFECTS PACKAGES: @esri/arcgis-rest-users --- packages/arcgis-rest-users/src/users.ts | 2 +- packages/arcgis-rest-users/test/users.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/arcgis-rest-users/src/users.ts b/packages/arcgis-rest-users/src/users.ts index 0769e25a04..875211cf8a 100644 --- a/packages/arcgis-rest-users/src/users.ts +++ b/packages/arcgis-rest-users/src/users.ts @@ -51,7 +51,7 @@ export function getUser( // if a username is passed, assume ArcGIS Online if (typeof requestOptions === "string") { - url = `http://www.arcgis.com/sharing/rest/community/users/${requestOptions}`; + url = `https://www.arcgis.com/sharing/rest/community/users/${requestOptions}`; } else { // if an authenticated session is passed, default to that user/portal unless another username is provided manually const username = diff --git a/packages/arcgis-rest-users/test/users.test.ts b/packages/arcgis-rest-users/test/users.test.ts index 2e1d46f0b7..4889570f25 100644 --- a/packages/arcgis-rest-users/test/users.test.ts +++ b/packages/arcgis-rest-users/test/users.test.ts @@ -45,7 +45,7 @@ describe("users", () => { expect(fetchMock.called()).toEqual(true); const [url, options]: [string, RequestInit] = fetchMock.lastCall("*"); expect(url).toEqual( - "http://www.arcgis.com/sharing/rest/community/users/jsmith?f=json" + "https://www.arcgis.com/sharing/rest/community/users/jsmith?f=json" ); expect(options.method).toBe("GET"); done();