forked from DebaucheryLibrarian/traxxx
Explicitly adding headers to http module result.
This commit is contained in:
parent
0a8a7ff9a5
commit
2be3ea9bbb
|
@ -549,6 +549,8 @@ async function fetchHttpSource(source, tempFileTarget, hashStream) {
|
||||||
throw new Error(`Response ${res.status} not OK`);
|
throw new Error(`Response ${res.status} not OK`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(res.headers);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
mimetype: (source.expectType
|
mimetype: (source.expectType
|
||||||
? source.expectType[res.headers['content-type']]
|
? source.expectType[res.headers['content-type']]
|
||||||
|
|
|
@ -122,6 +122,7 @@ async function finalizeResult(res, options) {
|
||||||
body: html,
|
body: html,
|
||||||
html,
|
html,
|
||||||
status: res.statusCode,
|
status: res.statusCode,
|
||||||
|
headers: res.headers,
|
||||||
document: window?.document || null,
|
document: window?.document || null,
|
||||||
window,
|
window,
|
||||||
ok: res.statusCode >= 200 && res.statusCode <= 299,
|
ok: res.statusCode >= 200 && res.statusCode <= 299,
|
||||||
|
@ -132,6 +133,7 @@ async function finalizeResult(res, options) {
|
||||||
...res,
|
...res,
|
||||||
body: res.body,
|
body: res.body,
|
||||||
status: res.statusCode,
|
status: res.statusCode,
|
||||||
|
headers: res.headers,
|
||||||
ok: res.statusCode >= 200 && res.statusCode <= 299,
|
ok: res.statusCode >= 200 && res.statusCode <= 299,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue