use Buffer everywhere

This commit is contained in:
Max Schmitt 2024-08-19 09:06:48 +02:00
parent bef3c15656
commit 87e9c61540
4 changed files with 14 additions and 14 deletions

View file

@ -531,9 +531,9 @@ Does not enforce fixed viewport, allows resizing window in the headed mode.
- `clientCertificates` <[Array]<[Object]>> - `clientCertificates` <[Array]<[Object]>>
- `origin` <[string]> Exact origin that the certificate is valid for. Origin includes `https` protocol, a hostname and optionally a port. - `origin` <[string]> Exact origin that the certificate is valid for. Origin includes `https` protocol, a hostname and optionally a port.
- `certPath` ?<[path]> Path to the file with the certificate in PEM format. - `certPath` ?<[path]> Path to the file with the certificate in PEM format.
- `cert` ?<[string]> Direct value of the certificate in PEM format. - `cert` ?<[Buffer]> Direct value of the certificate in PEM format.
- `keyPath` ?<[path]> Path to the file with the private key in PEM format. - `keyPath` ?<[path]> Path to the file with the private key in PEM format.
- `key` ?<[string]> Direct value of the private key in PEM format. - `key` ?<[Buffer]> Direct value of the private key in PEM format.
- `pfxPath` ?<[path]> Path to the PFX or PKCS12 encoded private key and certificate chain. - `pfxPath` ?<[path]> Path to the PFX or PKCS12 encoded private key and certificate chain.
- `pfx` ?<[Buffer]> Direct value of the PFX or PKCS12 encoded private key and certificate chain. - `pfx` ?<[Buffer]> Direct value of the PFX or PKCS12 encoded private key and certificate chain.
- `passphrase` ?<[string]> Passphrase for the private key (PEM or PFX). - `passphrase` ?<[string]> Passphrase for the private key (PEM or PFX).

View file

@ -49,9 +49,9 @@ export const kLifecycleEvents: Set<LifecycleEvent> = new Set(['load', 'domconten
export type ClientCertificate = { export type ClientCertificate = {
origin: string; origin: string;
cert?: string; cert?: Buffer;
certPath?: string; certPath?: string;
key?: string; key?: Buffer;
keyPath?: string; keyPath?: string;
pfx?: Buffer; pfx?: Buffer;
pfxPath?: string; pfxPath?: string;

View file

@ -9162,7 +9162,7 @@ export interface Browser {
/** /**
* Direct value of the certificate in PEM format. * Direct value of the certificate in PEM format.
*/ */
cert?: string; cert?: Buffer;
/** /**
* Path to the file with the private key in PEM format. * Path to the file with the private key in PEM format.
@ -9172,7 +9172,7 @@ export interface Browser {
/** /**
* Direct value of the private key in PEM format. * Direct value of the private key in PEM format.
*/ */
key?: string; key?: Buffer;
/** /**
* Path to the PFX or PKCS12 encoded private key and certificate chain. * Path to the PFX or PKCS12 encoded private key and certificate chain.
@ -13889,7 +13889,7 @@ export interface BrowserType<Unused = {}> {
/** /**
* Direct value of the certificate in PEM format. * Direct value of the certificate in PEM format.
*/ */
cert?: string; cert?: Buffer;
/** /**
* Path to the file with the private key in PEM format. * Path to the file with the private key in PEM format.
@ -13899,7 +13899,7 @@ export interface BrowserType<Unused = {}> {
/** /**
* Direct value of the private key in PEM format. * Direct value of the private key in PEM format.
*/ */
key?: string; key?: Buffer;
/** /**
* Path to the PFX or PKCS12 encoded private key and certificate chain. * Path to the PFX or PKCS12 encoded private key and certificate chain.
@ -16313,7 +16313,7 @@ export interface APIRequest {
/** /**
* Direct value of the certificate in PEM format. * Direct value of the certificate in PEM format.
*/ */
cert?: string; cert?: Buffer;
/** /**
* Path to the file with the private key in PEM format. * Path to the file with the private key in PEM format.
@ -16323,7 +16323,7 @@ export interface APIRequest {
/** /**
* Direct value of the private key in PEM format. * Direct value of the private key in PEM format.
*/ */
key?: string; key?: Buffer;
/** /**
* Path to the PFX or PKCS12 encoded private key and certificate chain. * Path to the PFX or PKCS12 encoded private key and certificate chain.
@ -20669,7 +20669,7 @@ export interface BrowserContextOptions {
/** /**
* Direct value of the certificate in PEM format. * Direct value of the certificate in PEM format.
*/ */
cert?: string; cert?: Buffer;
/** /**
* Path to the file with the private key in PEM format. * Path to the file with the private key in PEM format.
@ -20679,7 +20679,7 @@ export interface BrowserContextOptions {
/** /**
* Direct value of the private key in PEM format. * Direct value of the private key in PEM format.
*/ */
key?: string; key?: Buffer;
/** /**
* Path to the PFX or PKCS12 encoded private key and certificate chain. * Path to the PFX or PKCS12 encoded private key and certificate chain.

View file

@ -309,8 +309,8 @@ test.describe('browser', () => {
ignoreHTTPSErrors: true, ignoreHTTPSErrors: true,
clientCertificates: [{ clientCertificates: [{
origin: new URL(serverURL).origin, origin: new URL(serverURL).origin,
cert: (await fs.promises.readFile(asset('client-certificates/client/trusted/cert.pem'))).toString(), cert: await fs.promises.readFile(asset('client-certificates/client/trusted/cert.pem')),
key: (await fs.promises.readFile(asset('client-certificates/client/trusted/key.pem'))).toString(), key: await fs.promises.readFile(asset('client-certificates/client/trusted/key.pem')),
}], }],
}); });
await page.goto(serverURL); await page.goto(serverURL);