Skip to content

Commit c052319

Browse files
only use custom httpsagent if needed
1 parent 9ded0b2 commit c052319

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

src/classes/config/PackageParserConfigHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export class PackageParserConfigHandler implements IParserConfigHandler {
152152
return (
153153
this._config?.ui5?.ui5parser?.rejectUnauthorized ??
154154
PackageParserConfigHandler._globalConfig?.ui5?.ui5parser?.rejectUnauthorized ??
155-
false
155+
true
156156
);
157157
}
158158

src/classes/http/HTTPHandler.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ export class HTTPHandler {
1212
let data = {};
1313

1414
const rejectUnauthorized = this.configHandler.getRejectUnauthorized();
15-
const agent = new https.Agent({
16-
rejectUnauthorized: !!rejectUnauthorized
17-
});
18-
options.httpsAgent = agent;
15+
if (!rejectUnauthorized) options.httpsAgent = new https.Agent({ rejectUnauthorized: !!rejectUnauthorized });
1916

2017
try {
2118
if (HTTPHandler._requests[uri]) {

0 commit comments

Comments
 (0)