From 7fd4a6cb8f3df2e4f5f51ba2a46005ec02336eea Mon Sep 17 00:00:00 2001 From: bill bittner Date: Wed, 13 Dec 2017 15:09:01 -0800 Subject: [PATCH] added check for whether video is requested --- routes/serve-routes.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routes/serve-routes.js b/routes/serve-routes.js index b32ba70a..fea8b8ef 100644 --- a/routes/serve-routes.js +++ b/routes/serve-routes.js @@ -48,9 +48,9 @@ function clientAcceptsHtml ({accept}) { 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 videoIsWanted = false; + const videoIsWanted = accept && range; return imageIsWanted || videoIsWanted; }