Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
c7765c4498
|
@ -319,9 +319,9 @@ function convertBody(buffer, headers) {
|
||||||
|
|
||||||
// turn raw buffers into a single utf-8 buffer
|
// turn raw buffers into a single utf-8 buffer
|
||||||
return convert(
|
return convert(
|
||||||
buffer
|
buffer,
|
||||||
, 'UTF-8'
|
'UTF-8',
|
||||||
, charset
|
charset
|
||||||
).toString();
|
).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
12
src/index.js
12
src/index.js
|
@ -135,12 +135,12 @@ export default function fetch(url, opts) {
|
||||||
// prepare response
|
// prepare response
|
||||||
let body = res.pipe(new PassThrough());
|
let body = res.pipe(new PassThrough());
|
||||||
const response_options = {
|
const response_options = {
|
||||||
url: request.url
|
url: request.url,
|
||||||
, status: res.statusCode
|
status: res.statusCode,
|
||||||
, statusText: res.statusMessage
|
statusText: res.statusMessage,
|
||||||
, headers: headers
|
headers: headers,
|
||||||
, size: request.size
|
size: request.size,
|
||||||
, timeout: request.timeout
|
timeout: request.timeout
|
||||||
};
|
};
|
||||||
|
|
||||||
// HTTP-network fetch step 12.1.1.3
|
// HTTP-network fetch step 12.1.1.3
|
||||||
|
|
|
@ -62,13 +62,12 @@ export default class Response {
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
clone() {
|
clone() {
|
||||||
|
|
||||||
return new Response(clone(this), {
|
return new Response(clone(this), {
|
||||||
url: this.url
|
url: this.url,
|
||||||
, status: this.status
|
status: this.status,
|
||||||
, statusText: this.statusText
|
statusText: this.statusText,
|
||||||
, headers: this.headers
|
headers: this.headers,
|
||||||
, ok: this.ok
|
ok: this.ok
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
461
test/test.js
461
test/test.js
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue