Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix options passed to head request #593

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ export async function getAssetPaths(document, file, options = {}, strict = true)
*/
export async function vinylize(src, options = {}) {
const {filepath, html} = src;
const {rebase = {}} = options;
const {rebase = {}, request = {}} = options;
const file = new Vinyl();
file.cwd = '/';
file.remote = false;
Expand All @@ -792,7 +792,7 @@ export async function vinylize(src, options = {}) {
} else if (filepath && isRemote(filepath)) {
let url = filepath;
try {
const response = await fetch(filepath, {options, request: {method: 'head'}});
const response = await fetch(filepath, {...options, request: {...request, method: 'head'}});
if (response.url !== url) {
debug(`(vinylize) found redirect from ${url} to ${response.url}`);
url = response.url;
Expand Down