diff --git a/sdk/core/core-rest-pipeline/src/nodeHttpClient.ts b/sdk/core/core-rest-pipeline/src/nodeHttpClient.ts index f750d303e3c8..4dafde592688 100644 --- a/sdk/core/core-rest-pipeline/src/nodeHttpClient.ts +++ b/sdk/core/core-rest-pipeline/src/nodeHttpClient.ts @@ -207,7 +207,7 @@ class NodeHttpClient implements HttpClient { throw new Error(`Cannot connect to ${request.url} while allowInsecureConnection is false.`); } - const agent = request.agent ?? this.getOrCreateAgent(request, isInsecure); + const agent = (request.agent as http.Agent) ?? this.getOrCreateAgent(request, isInsecure); const options: http.RequestOptions = { agent, hostname: url.hostname, diff --git a/sdk/identity/identity/test/internal/node/interactiveBrowserCredential.spec.ts b/sdk/identity/identity/test/internal/node/interactiveBrowserCredential.spec.ts index ca006da32690..b90d1b8e62ff 100644 --- a/sdk/identity/identity/test/internal/node/interactiveBrowserCredential.spec.ts +++ b/sdk/identity/identity/test/internal/node/interactiveBrowserCredential.spec.ts @@ -12,8 +12,6 @@ import { InteractiveBrowserCredential } from "../../../src"; import { MsalTestCleanup, msalNodeTestSetup } from "../../msalTestUtils"; import { interactiveBrowserMockable } from "../../../src/msal/nodeFlows/msalOpenBrowser"; -import { URL } from "url"; - declare global { namespace NodeJS { interface Global { @@ -38,11 +36,6 @@ describe("InteractiveBrowserCredential (internal)", function() { const scope = "https://vault.azure.net/.default"; it("Throws an expected error if no browser is available", async function(this: Context) { - // On Node 8, URL is not defined. We use URL on the msalOpenBrowser.ts file. - if (process.version.startsWith("v8.")) { - global.URL = URL; - } - // The SinonStub type does not include this second parameter to throws(). const testErrorMessage = "No browsers available on this test."; (sandbox.stub(interactiveBrowserMockable, "open") as any).throws("TestError", testErrorMessage); diff --git a/sdk/test-utils/perfstress/src/policy.ts b/sdk/test-utils/perfstress/src/policy.ts index d0093035f852..c259da90607b 100644 --- a/sdk/test-utils/perfstress/src/policy.ts +++ b/sdk/test-utils/perfstress/src/policy.ts @@ -14,7 +14,7 @@ import * as url from "url"; */ export class PerfStressPolicy extends BaseRequestPolicy { private host: string; - private port?: string; + private port?: string | null; /** * It receives the common parameters sent to any core-http policy, plus the host and the port. @@ -27,7 +27,7 @@ export class PerfStressPolicy extends BaseRequestPolicy { nextPolicy: RequestPolicy, options: RequestPolicyOptions, host: string, - port?: string + port?: string | null ) { super(nextPolicy, options); this.host = host;