diff --git a/src/media.js b/src/media.js index 13c0feda..e0e09aaa 100644 --- a/src/media.js +++ b/src/media.js @@ -549,6 +549,8 @@ async function fetchHttpSource(source, tempFileTarget, hashStream) { throw new Error(`Response ${res.status} not OK`); } + console.log(res.headers); + return { mimetype: (source.expectType ? source.expectType[res.headers['content-type']] diff --git a/src/utils/http.js b/src/utils/http.js index 17c4289e..b542997b 100644 --- a/src/utils/http.js +++ b/src/utils/http.js @@ -122,6 +122,7 @@ async function finalizeResult(res, options) { body: html, html, status: res.statusCode, + headers: res.headers, document: window?.document || null, window, ok: res.statusCode >= 200 && res.statusCode <= 299, @@ -132,6 +133,7 @@ async function finalizeResult(res, options) { ...res, body: res.body, status: res.statusCode, + headers: res.headers, ok: res.statusCode >= 200 && res.statusCode <= 299, }; }