Skip to content

Commit e20111c

Browse files
committed
Optimize trusted CA cert data in passthrough rules slightly
Previously we had to unwrap the promise for every single request - bit pointless when it's just fixed data, so let's just unwrap it in advance.
1 parent 639cdfc commit e20111c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/rules/requests/request-step-impls.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,11 @@ export class PassThroughStepImpl extends PassThroughStep {
446446
if (!this.extraCACertificates.length) return undefined;
447447

448448
if (!this._trustedCACertificates) {
449-
this._trustedCACertificates = getTrustedCAs(undefined, this.extraCACertificates);
449+
this._trustedCACertificates = getTrustedCAs(undefined, this.extraCACertificates)
450+
.then((certs) => {
451+
this._trustedCACertificates = certs; // Unwrap the promise
452+
return certs;
453+
});
450454
}
451455

452456
return this._trustedCACertificates;

0 commit comments

Comments
 (0)