From 3c10811c2344f75f8ac7b5c0b716a27b9203eae5 Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Thu, 9 Feb 2023 18:34:51 -0800 Subject: [PATCH] Types: fixed Fetch API types. --- test/ts/test.ts | 3 +++ ts/ngx_core.d.ts | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/test/ts/test.ts b/test/ts/test.ts index cc339293..ddbb495e 100644 --- a/test/ts/test.ts +++ b/test/ts/test.ts @@ -91,6 +91,9 @@ async function http_module(r: NginxHTTPRequest) { throw 'oops' }; + let out: Array = reply.headers.getAll("foo"); + let has: boolean = reply.headers.has("foo"); + return reply.text() }) .then(body => r.return(200, body)) diff --git a/ts/ngx_core.d.ts b/ts/ngx_core.d.ts index 042e6f25..cb5e47f5 100644 --- a/ts/ngx_core.d.ts +++ b/ts/ngx_core.d.ts @@ -10,13 +10,13 @@ interface NgxResponseHeaders { * with the specified name. * @param name A name of the header. */ - getAll(name:NjsStringLike): NjsByteString; + getAll(name:NjsStringLike): Array; /** * Returns a boolean value indicating whether a header with * the specified name exists. * @param name A name of the header. */ - has(name:NjsStringLike): NjsByteString; + has(name:NjsStringLike): boolean; } interface NgxResponse { -- 2.47.3