281 unfurl show links #303

Merged
bones7242 merged 12 commits from 281-unfurl-show-links into master 2017-12-15 17:01:23 +01:00
Showing only changes of commit 7fd4a6cb8f - Show all commits

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