Skip to content

Commit c625483

Browse files
committed
Fix TS error
1 parent 8a19a7c commit c625483

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

extra-checks/ts-compat-check/shims.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
declare module "http" {
22
export class IncomingMessage { }
3-
export class OutgoingHttpHeaders { }
3+
export type OutgoingHttpHeader = unknown;
44
}
55

66
declare module "@cloudflare/workers-types/2023-03-01" {

src/node/NodeHttpConfigFetcher.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export class NodeHttpConfigFetcher implements IConfigCatConfigFetcher {
9292

9393
const { lastETag, timeoutMs } = request;
9494

95-
const requestOptions: http.RequestOptions | https.RequestOptions = {
95+
const requestOptions: (http.RequestOptions | https.RequestOptions) & { headers?: Record<string, http.OutgoingHttpHeader> } = {
9696
agent,
9797
timeout: timeoutMs,
9898
};
@@ -126,7 +126,7 @@ export class NodeHttpConfigFetcher implements IConfigCatConfigFetcher {
126126
});
127127
}
128128

129-
protected setRequestHeaders(requestOptions: { headers?: http.OutgoingHttpHeaders }, headers: ReadonlyArray<[string, string]>): void {
129+
protected setRequestHeaders(requestOptions: { headers?: Record<string, http.OutgoingHttpHeader> }, headers: ReadonlyArray<[string, string]>): void {
130130
if (headers.length) {
131131
const currentHeaders = requestOptions.headers ??= {};
132132
for (const [name, value] of headers) {

0 commit comments

Comments
 (0)