summaryrefslogtreecommitdiff
path: root/js/headers.ts
diff options
context:
space:
mode:
Diffstat (limited to 'js/headers.ts')
-rw-r--r--js/headers.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/js/headers.ts b/js/headers.ts
index 2f15f14da..e31c0903e 100644
--- a/js/headers.ts
+++ b/js/headers.ts
@@ -57,11 +57,11 @@ class HeadersBase {
// If header does not contain exactly two items,
// then throw a TypeError.
// ref: https://fetch.spec.whatwg.org/#concept-headers-fill
- if (tuple.length !== 2) {
- throw new TypeError(
- "Failed to construct 'Headers'; Each header pair must be an iterable [name, value] tuple"
- );
- }
+ requiredArguments(
+ "Headers.constructor tuple array argument",
+ tuple.length,
+ 2
+ );
const [name, value] = this._normalizeParams(tuple[0], tuple[1]);
this._validateName(name);