[Bug] http-cache fails for object URLs
chrisguttandin opened this issue Β· comments
π Bug report
Description
Sometimes http-cache picks up object URLs and throws an error. I guess object URLs should be ignored as it is already the case with data URIs.
hint/packages/hint-http-cache/src/hint.ts
Lines 487 to 491 in f1b2f4f
Details
This is the error currently reported by http-cache:
blob:https://example.com/72849c07-8b96-412c-b8fe-90c63e8d2c44
Error A 'cache-control' header is missing or empty. http-cache
Γ Found 1 error, 0 warnings, 0 hints and 0 informations
If you agree that this is a viable fix I would be happy implement isObjectURL()
similar to isDataURI()
which could then be used like this to ignore object URLs, too:
if (isDataURI(resource) || isObjectURL(resource)) {
debug(`Check does not apply for data URIs and object URLs`);
return;
}