added check for whether video is requested

This commit is contained in:
bill bittner 2017-12-13 15:09:01 -08:00
parent ac14231f66
commit 7fd4a6cb8f

View file

@ -48,9 +48,9 @@ function clientAcceptsHtml ({accept}) {
return accept && accept.match(/text\/html/); return accept && accept.match(/text\/html/);
} }
function clientWantsAsset ({accept}) { function clientWantsAsset ({accept, range}) {
const imageIsWanted = accept && accept.match(/image\/.*/) && !accept.match(/text\/html/) && !accept.match(/text\/\*/); // checks if an image is accepted, but not a video const imageIsWanted = accept && accept.match(/image\/.*/) && !accept.match(/text\/html/) && !accept.match(/text\/\*/); // checks if an image is accepted, but not a video
const videoIsWanted = false; const videoIsWanted = accept && range;
return imageIsWanted || videoIsWanted; return imageIsWanted || videoIsWanted;
} }