webhintio / hint

πŸ’‘ A hinting engine for the web

Home Page:https://webhint.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[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.

if (isDataURI(resource)) {
debug(`Check does not apply for data URIs`);
return;
}

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; 
}