From: Dmitry Volyntsev Date: Fri, 10 Feb 2023 02:34:51 +0000 (-0800) Subject: Types: fixed Fetch API types. X-Git-Tag: 0.7.11~24 X-Git-Url: http://www.kaiwu.me/postgresql/commit/static/gitweb.js?a=commitdiff_plain;h=3c10811c2344f75f8ac7b5c0b716a27b9203eae5;p=njs.git Types: fixed Fetch API types. --- 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 {