From 1bdbefacf6606fab40a33465c5d197a02eeba6bd Mon Sep 17 00:00:00 2001 From: Marius Kleidl Date: Fri, 23 Aug 2024 17:15:26 +0200 Subject: [PATCH] Allow `getHeader` methods to return `undefined` --- docs/api.md | 4 ++-- lib/index.d.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/api.md b/docs/api.md index 6eca123e..ef36def5 100644 --- a/docs/api.md +++ b/docs/api.md @@ -322,7 +322,7 @@ interface HttpRequest { getURL(): string; setHeader(header: string, value: string); - getHeader(header: string); + getHeader(header: string): string | undefined; setProgressHandler((bytesSent: number): void): void; // Send the HTTP request with the provided request body. The value of the request body depends @@ -339,7 +339,7 @@ interface HttpRequest { interface HttpResponse { getStatus(): number; - getHeader(header: string): string; + getHeader(header: string): string | undefined; getBody(): string; // Return an environment specific object, e.g. the XMLHttpRequest object in browsers. diff --git a/lib/index.d.ts b/lib/index.d.ts index 57b04197..cb093d35 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -106,7 +106,7 @@ export interface HttpRequest { getURL(): string setHeader(header: string, value: string): void - getHeader(header: string): string + getHeader(header: string): string | undefined setProgressHandler(handler: (bytesSent: number) => void): void send(body: any): Promise @@ -118,7 +118,7 @@ export interface HttpRequest { export interface HttpResponse { getStatus(): number - getHeader(header: string): string + getHeader(header: string): string | undefined getBody(): string // Return an environment specific object, e.g. the XMLHttpRequest object in browsers.