Skip to content

Commit

Permalink
Remove the special casing of "external" links pointing at file: (via …
Browse files Browse the repository at this point in the history
…stopProcessing)

This is now handled in assetgraph by having asset.load({metadataOnly: true})
issue an fs.stat call.

#143 (comment)
  • Loading branch information
papandreou committed Apr 5, 2018
1 parent 55ec856 commit fbaa61b
Showing 1 changed file with 2 additions and 27 deletions.
29 changes: 2 additions & 27 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,6 @@ async function hyperlink(
}
}

// In non-recursive mode local assets might be marked as end-of-line.
// This is specifically relevant to local file-URLs
if (asset.stopProcessing) {
return;
}

// Save info for the redirect check later
if (asset.statusCode >= 300 && asset.statusCode < 400) {
const redirectRelation = asset.outgoingRelations.find(
Expand Down Expand Up @@ -416,17 +410,7 @@ async function hyperlink(
if (!relation.crossorigin && recursive) {
follow = true;
} else if (relation.from !== relation.to) {
// If we are handling local file-urls, follow but mark as end-of-line in processing
if (
!recursive &&
relation.from.protocol === 'file:' &&
relation.to.protocol === 'file:'
) {
follow = true;
relation.to.stopProcessing = true;
} else {
metadataOnly = true;
}
metadataOnly = true;
}
} else if (
/^(?:JavaScript|Css)Source(?:Mapping)Url$/.test(relation.type)
Expand All @@ -448,16 +432,7 @@ async function hyperlink(

if (follow || metadataOnly) {
if (assetTypesWithoutRelations.includes(relation.to.type)) {
// If we are handling local file-urls, follow but mark as end-of-line in processing
if (
relation.from.protocol === 'file:' &&
relation.to.protocol === 'file:'
) {
relation.to.stopProcessing = !recursive;
assetQueue.push(relation.to);
} else {
metadataOnly = true;
}
metadataOnly = true;
} else {
assetQueue.push(relation.to);
}
Expand Down

0 comments on commit fbaa61b

Please sign in to comment.