Comparing version 3.8.0 to 3.8.1
3.8.1 / 2022-12-16 | ||
================== | ||
**fixes** | ||
* [[`3c731cc`](http://github.com/node-modules/urllib/commit/3c731cc3a376f84d5d5d4b6af0b0b986891eac12)] - 🐛 FIX: HttpClientResponse.res should be IncomingMessage (#426) (fengmk2 <<fengmk2@gmail.com>>) | ||
3.8.0 / 2022-12-14 | ||
@@ -3,0 +9,0 @@ ================== |
{ | ||
"name": "urllib", | ||
"version": "3.8.0", | ||
"version": "3.8.1", | ||
"publishConfig": { | ||
@@ -5,0 +5,0 @@ "tag": "latest" |
@@ -190,3 +190,3 @@ "use strict"; | ||
const resHeaders = {}; | ||
const res = { | ||
let res = { | ||
status: -1, | ||
@@ -423,13 +423,5 @@ statusCode: -1, | ||
let data = null; | ||
let responseBodyStream; | ||
if (args.dataType === 'stream') { | ||
// streaming mode will disable retry | ||
args.retry = 0; | ||
const meta = { | ||
status: res.status, | ||
statusCode: res.statusCode, | ||
headers: res.headers, | ||
timing, | ||
socket: socketInfo, | ||
}; | ||
// only auto decompress on request args.compressed = true | ||
@@ -439,6 +431,6 @@ if (args.compressed === true && isCompressedContent) { | ||
const decoder = contentEncoding === 'gzip' ? (0, zlib_1.createGunzip)() : (0, zlib_1.createBrotliDecompress)(); | ||
responseBodyStream = Object.assign((0, stream_1.pipeline)(response.body, decoder, noop), meta); | ||
res = Object.assign((0, stream_1.pipeline)(response.body, decoder, noop), res); | ||
} | ||
else { | ||
responseBodyStream = Object.assign(response.body, meta); | ||
res = Object.assign(response.body, res); | ||
} | ||
@@ -495,3 +487,3 @@ } | ||
requestUrls: res.requestUrls, | ||
res: responseBodyStream !== null && responseBodyStream !== void 0 ? responseBodyStream : res, | ||
res, | ||
}; | ||
@@ -498,0 +490,0 @@ if (args.retry > 0 && requestContext.retries < args.retry) { |
@@ -28,3 +28,3 @@ /// <reference types="node" /> | ||
}; | ||
export type BaseResponseMeta = { | ||
export type RawResponseWithMeta = Readable & { | ||
status: number; | ||
@@ -35,4 +35,2 @@ statusCode: number; | ||
socket: SocketInfo; | ||
}; | ||
export type HttpClientResponseMeta = BaseResponseMeta & { | ||
size: number; | ||
@@ -44,3 +42,2 @@ aborted: boolean; | ||
}; | ||
export type ReadableWithMeta = Readable & BaseResponseMeta; | ||
export type HttpClientResponse = { | ||
@@ -55,3 +52,3 @@ opaque: unknown; | ||
requestUrls: string[]; | ||
res: ReadableWithMeta | HttpClientResponseMeta; | ||
res: RawResponseWithMeta; | ||
}; |
@@ -186,3 +186,3 @@ var _a, _b; | ||
const resHeaders = {}; | ||
const res = { | ||
let res = { | ||
status: -1, | ||
@@ -419,13 +419,5 @@ statusCode: -1, | ||
let data = null; | ||
let responseBodyStream; | ||
if (args.dataType === 'stream') { | ||
// streaming mode will disable retry | ||
args.retry = 0; | ||
const meta = { | ||
status: res.status, | ||
statusCode: res.statusCode, | ||
headers: res.headers, | ||
timing, | ||
socket: socketInfo, | ||
}; | ||
// only auto decompress on request args.compressed = true | ||
@@ -435,6 +427,6 @@ if (args.compressed === true && isCompressedContent) { | ||
const decoder = contentEncoding === 'gzip' ? createGunzip() : createBrotliDecompress(); | ||
responseBodyStream = Object.assign(pipeline(response.body, decoder, noop), meta); | ||
res = Object.assign(pipeline(response.body, decoder, noop), res); | ||
} | ||
else { | ||
responseBodyStream = Object.assign(response.body, meta); | ||
res = Object.assign(response.body, res); | ||
} | ||
@@ -491,3 +483,3 @@ } | ||
requestUrls: res.requestUrls, | ||
res: responseBodyStream !== null && responseBodyStream !== void 0 ? responseBodyStream : res, | ||
res, | ||
}; | ||
@@ -494,0 +486,0 @@ if (args.retry > 0 && requestContext.retries < args.retry) { |
@@ -28,3 +28,3 @@ /// <reference types="node" /> | ||
}; | ||
export type BaseResponseMeta = { | ||
export type RawResponseWithMeta = Readable & { | ||
status: number; | ||
@@ -35,4 +35,2 @@ statusCode: number; | ||
socket: SocketInfo; | ||
}; | ||
export type HttpClientResponseMeta = BaseResponseMeta & { | ||
size: number; | ||
@@ -44,3 +42,2 @@ aborted: boolean; | ||
}; | ||
export type ReadableWithMeta = Readable & BaseResponseMeta; | ||
export type HttpClientResponse = { | ||
@@ -55,3 +52,3 @@ opaque: unknown; | ||
requestUrls: string[]; | ||
res: ReadableWithMeta | HttpClientResponseMeta; | ||
res: RawResponseWithMeta; | ||
}; |
@@ -32,3 +32,3 @@ import { EventEmitter } from 'events'; | ||
import { RequestURL, RequestOptions, HttpMethod } from './Request'; | ||
import { HttpClientResponseMeta, HttpClientResponse, ReadableWithMeta, BaseResponseMeta, SocketInfo } from './Response'; | ||
import { RawResponseWithMeta, HttpClientResponse, SocketInfo } from './Response'; | ||
import { parseJSON, sleep, digestAuthHeader, globalId, performanceTime, isReadable } from './utils'; | ||
@@ -247,3 +247,3 @@ import symbols from './symbols'; | ||
const resHeaders: IncomingHttpHeaders = {}; | ||
const res: HttpClientResponseMeta = { | ||
let res = { | ||
status: -1, | ||
@@ -259,3 +259,3 @@ statusCode: -1, | ||
socket: socketInfo, | ||
}; | ||
} as any as RawResponseWithMeta; | ||
@@ -477,13 +477,5 @@ let headersTimeout = 5000; | ||
let data: any = null; | ||
let responseBodyStream: ReadableWithMeta | undefined; | ||
if (args.dataType === 'stream') { | ||
// streaming mode will disable retry | ||
args.retry = 0; | ||
const meta: BaseResponseMeta = { | ||
status: res.status, | ||
statusCode: res.statusCode, | ||
headers: res.headers, | ||
timing, | ||
socket: socketInfo, | ||
}; | ||
// only auto decompress on request args.compressed = true | ||
@@ -493,5 +485,5 @@ if (args.compressed === true && isCompressedContent) { | ||
const decoder = contentEncoding === 'gzip' ? createGunzip() : createBrotliDecompress(); | ||
responseBodyStream = Object.assign(pipeline(response.body, decoder, noop), meta); | ||
res = Object.assign(pipeline(response.body, decoder, noop), res); | ||
} else { | ||
responseBodyStream = Object.assign(response.body, meta); | ||
res = Object.assign(response.body, res); | ||
} | ||
@@ -543,3 +535,3 @@ } else if (args.writeStream) { | ||
requestUrls: res.requestUrls, | ||
res: responseBodyStream ?? res, | ||
res, | ||
}; | ||
@@ -546,0 +538,0 @@ |
@@ -37,3 +37,3 @@ import { Readable } from 'stream'; | ||
export type BaseResponseMeta = { | ||
export type RawResponseWithMeta = Readable & { | ||
status: number; | ||
@@ -45,5 +45,2 @@ statusCode: number; | ||
socket: SocketInfo; | ||
}; | ||
export type HttpClientResponseMeta = BaseResponseMeta & { | ||
size: number; | ||
@@ -56,4 +53,2 @@ aborted: boolean; | ||
export type ReadableWithMeta = Readable & BaseResponseMeta; | ||
export type HttpClientResponse = { | ||
@@ -69,3 +64,3 @@ opaque: unknown; | ||
requestUrls: string[]; | ||
res: ReadableWithMeta | HttpClientResponseMeta; | ||
res: RawResponseWithMeta; | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
266218
3560