summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/http.ts
diff options
context:
space:
mode:
authormash-graz <mash-graz@users.noreply.github.com>2024-03-10 23:46:05 +0100
committerGitHub <noreply@github.com>2024-03-10 22:46:05 +0000
commit16dbbfa64a5d2905580535c52c1db51d1cf5b89f (patch)
tree5cf86fd3955309a86149322dd2664d15b33c31ea /ext/node/polyfills/http.ts
parent0e644503690f23ced5c13c5d3e59592ce1858018 (diff)
fix(node:http) Export `validateHeaderName` and `validateHeaderValue` functions (#22616)
Modify `_http_outgoing.ts` to support the extended signature of `validateHeaderName()` used since node v19.5.0/v18.14.0 by adding the `label` parameter. (see: https://nodejs.org/api/http.html#httpvalidateheadernamename-label) Making both validation functions accessible as public exports of `node:http` Fixes: #22614
Diffstat (limited to 'ext/node/polyfills/http.ts')
-rw-r--r--ext/node/polyfills/http.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/node/polyfills/http.ts b/ext/node/polyfills/http.ts
index bcbf6674f..933a8dbcd 100644
--- a/ext/node/polyfills/http.ts
+++ b/ext/node/polyfills/http.ts
@@ -38,6 +38,7 @@ import {
OutgoingMessage,
parseUniqueHeadersOption,
validateHeaderName,
+ validateHeaderValue,
} from "ext:deno_node/_http_outgoing.ts";
import { ok as assert } from "node:assert";
import { kOutHeaders } from "ext:deno_node/internal/http.ts";
@@ -1824,6 +1825,8 @@ export {
METHODS,
OutgoingMessage,
STATUS_CODES,
+ validateHeaderName,
+ validateHeaderValue,
};
export default {
Agent,
@@ -1840,4 +1843,6 @@ export default {
ServerResponse,
request,
get,
+ validateHeaderName,
+ validateHeaderValue,
};