Skip to content

Commit

Permalink
Set containingUrlUnused when FileImporter returns null (#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntkme committed May 10, 2024
1 parent bce32f3 commit 62a80b7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/src/importer-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,11 @@ export class ImporterRegistry<sync extends 'sync' | 'async'> {
return thenOr(
importer.findFileUrl(request.url, canonicalizeContext),
url => {
if (!url) return new proto.InboundMessage_FileImportResponse();
if (!url) {
return new proto.InboundMessage_FileImportResponse({
containingUrlUnused: !canonicalizeContext.containingUrlAccessed,
});
}
if (url.protocol !== 'file:') {
throw (
`FileImporter ${inspect(importer)} returned non-file: URL ` +
Expand Down

0 comments on commit 62a80b7

Please sign in to comment.