Skip to content

Commit 7359262

Browse files
Improve request options handling in utility-common (#503)
1 parent c9785fc commit 7359262

File tree

3 files changed

+25
-26
lines changed

3 files changed

+25
-26
lines changed

common-npm-packages/utility-common/package-lock.json

Lines changed: 20 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common-npm-packages/utility-common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "azure-pipelines-tasks-utility-common",
3-
"version": "3.258.0",
3+
"version": "3.265.0",
44
"description": "Common Library for Azure Rest Calls",
55
"repository": {
66
"type": "git",

common-npm-packages/utility-common/restutilities.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"use strict";
22

3-
var fs = require('fs');
43
import * as tl from "azure-pipelines-task-lib/task";
54

65
import httpClient = require("typed-rest-client/HttpClient");
@@ -57,11 +56,11 @@ export async function sendRequest(request: WebRequest, options?: WebRequestOptio
5756

5857
let ignoreSslErrors: string = tl.getVariable("VSTS_ARM_REST_IGNORE_SSL_ERRORS");
5958
requestOptions.ignoreSslError = ignoreSslErrors && ignoreSslErrors.toLowerCase() == "true";
60-
requestOptions.globalAgentOptions = options.httpGlobalAgentOptions;
61-
requestOptions.socketTimeout = options.socketTimeout;
62-
59+
requestOptions.globalAgentOptions = options?.httpGlobalAgentOptions;
60+
requestOptions.socketTimeout = options?.socketTimeout;
61+
6362
const httpCallbackClient = new httpClient.HttpClient(tl.getVariable("AZURE_HTTP_USER_AGENT"), null, requestOptions);
64-
63+
6564
while (true) {
6665
try {
6766
let response: WebResponse = await sendRequestInternal(request, httpCallbackClient);

0 commit comments

Comments
 (0)