Comparing version 2.0.4 to 2.0.5
@@ -185,3 +185,3 @@ "use strict"; | ||
pushedStream.once("push", guard((responseHeaders) => { | ||
const response = new response_1.StreamResponse(this._getDecoders(origin), path, pushedStream, responseHeaders, false, {}, 2); | ||
const response = new response_1.StreamResponse(this._getDecoders(origin), path, pushedStream, responseHeaders, false, {}, 2, false); | ||
resolve(response); | ||
@@ -188,0 +188,0 @@ })); |
@@ -60,2 +60,3 @@ /// <reference types="node" /> | ||
headers: RawHeaders | Headers; | ||
allowForbiddenHeaders: boolean; | ||
} | ||
@@ -62,0 +63,0 @@ export declare class FetchError extends Error { |
@@ -83,3 +83,3 @@ "use strict"; | ||
statusText: res.statusMessage, | ||
}, 1, integrity)); | ||
}, 1, input.allowForbiddenHeaders, integrity)); | ||
if (redirect === "error") | ||
@@ -86,0 +86,0 @@ return reject(fetch_common_1.makeRedirectionError(location)); |
@@ -131,3 +131,3 @@ "use strict"; | ||
? false | ||
: extra.redirected.length > 0, {}, 2, integrity)); | ||
: extra.redirected.length > 0, {}, 2, input.allowForbiddenHeaders, integrity)); | ||
if (redirect === "error") | ||
@@ -134,0 +134,0 @@ return reject(fetch_common_1.makeRedirectionError(location)); |
@@ -1,1 +0,1 @@ | ||
export declare const version = "2.0.4"; | ||
export declare const version = "2.0.5"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.version = "2.0.4"; | ||
exports.version = "2.0.5"; | ||
//# sourceMappingURL=version.js.map |
@@ -153,2 +153,3 @@ "use strict"; | ||
super((_guard = guard, init)); | ||
_guard = null; | ||
} | ||
@@ -155,0 +156,0 @@ } |
@@ -29,4 +29,4 @@ /// <reference types="node" /> | ||
export declare class StreamResponse extends Response { | ||
constructor(contentDecoders: ReadonlyArray<Decoder>, url: string, stream: NodeJS.ReadableStream, headers: IncomingHttpHeaders, redirected: boolean, init: Partial<ResponseInit>, httpVersion: HttpVersion, integrity?: string); | ||
constructor(contentDecoders: ReadonlyArray<Decoder>, url: string, stream: NodeJS.ReadableStream, headers: IncomingHttpHeaders, redirected: boolean, init: Partial<ResponseInit>, httpVersion: HttpVersion, allowForbiddenHeaders: boolean, integrity?: string); | ||
} | ||
export {}; |
@@ -11,3 +11,5 @@ "use strict"; | ||
super(); | ||
const headers = headers_1.ensureHeaders(init.headers); | ||
const headers = headers_1.ensureHeaders(init.allowForbiddenHeaders | ||
? new headers_1.GuardedHeaders("none", init.headers) | ||
: init.headers); | ||
const _extra = (extra || {}); | ||
@@ -139,5 +141,6 @@ const type = _extra.type || "basic"; | ||
class StreamResponse extends Response { | ||
constructor(contentDecoders, url, stream, headers, redirected, init, httpVersion, integrity) { | ||
constructor(contentDecoders, url, stream, headers, redirected, init, httpVersion, allowForbiddenHeaders, integrity) { | ||
super(handleEncoding(contentDecoders, stream, headers), { | ||
...init, | ||
allowForbiddenHeaders, | ||
...(httpVersion === 1 | ||
@@ -144,0 +147,0 @@ ? makeInitHttp1(headers) |
{ | ||
"name": "fetch-h2", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"description": "HTTP/1+2 Fetch API client for Node.js", | ||
@@ -5,0 +5,0 @@ "author": "Gustaf Räntilä", |
@@ -161,2 +161,3 @@ [![npm version][npm-image]][npm-url] | ||
* The `Request` class (options to `fetch`) has an extra property `allowForbiddenHeaders`, which defaults to `false`. | ||
* The `Response` class also has an extra property `allowForbiddenHeaders`, which defaults to `false` (or to the value of the `Request` if it was constructed through a `fetch` call, which is the common case). | ||
* The response object has an extra property `httpVersion` which is either `1` or `2` (numbers), depending on what was negotiated with the server. | ||
@@ -163,0 +164,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
325520
4177
390