From 3998e6f936fac0524741ed2da7098a068e1b9703 Mon Sep 17 00:00:00 2001 From: yushengchen Date: Tue, 6 May 2025 16:51:40 +0800 Subject: [PATCH 1/2] doc: type improvement of file `http.md` `outgoingMessage.setHeader` and `outgoingMessage.getHeader` section --- doc/api/http.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/http.md b/doc/api/http.md index 19d0f017f5f920..7ff7038fab1b2b 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -3171,7 +3171,7 @@ added: v0.4.0 --> * `name` {string} Name of header -* Returns: {string | undefined} +* Returns: {number | string | string\[] | undefined} Gets the value of the HTTP header with the given name. If that header is not set, the returned value will be `undefined`. @@ -3273,7 +3273,7 @@ added: v0.4.0 --> * `name` {string} Header name -* `value` {any} Header value +* `value` {number | string | string\[]} Header value * Returns: {this} Sets a single header value. If the header already exists in the to-be-sent From a9ed0be71ade3a61cd536b3e212761d92abae49b Mon Sep 17 00:00:00 2001 From: yusheng chen Date: Tue, 6 May 2025 18:56:47 +0800 Subject: [PATCH 2/2] doc: type improvement of file `http.md` `response.setHeader` and `response.getHeader` section --- doc/api/http.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/http.md b/doc/api/http.md index 7ff7038fab1b2b..77a92c3f40b317 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -2085,7 +2085,7 @@ added: v0.4.0 --> * `name` {string} -* Returns: {any} +* Returns: {number | string | string\[] | undefined} Reads out a header that's already been queued but not sent to the client. The name is case-insensitive. The type of the return value depends @@ -2220,7 +2220,7 @@ added: v0.4.0 --> * `name` {string} -* `value` {any} +* `value` {number | string | string\[]} * Returns: {http.ServerResponse} Returns the response object.