Development #287

Merged
bones7242 merged 58 commits from development into master 2017-12-11 20:53:02 +01:00
2 changed files with 5 additions and 2 deletions
Showing only changes of commit a6ccc9b682 - Show all commits

View file

@ -6,7 +6,7 @@ function handleLbrynetResponse ({ data }, resolve, reject) {
if (data.result) { if (data.result) {
// check for an error // check for an error
if (data.result.error) { if (data.result.error) {
logger.warn('Lbrynet api error:', data.result.error); logger.debug('Lbrynet api error:', data.result.error);
reject(data.result.error); reject(data.result.error);
return; return;
}; };

View file

@ -152,12 +152,15 @@ function determineResponseType (uri, headers) {
} }
} else { } else {
responseType = SHOW; responseType = SHOW;
if (!headers['accept'] || !headers['accept'].split(',').includes('text/html')) {
responseType = SERVE;
}
} }
return responseType; return responseType;
} }
function determineName (uri) { function determineName (uri) {
/* patch because twitter player preview adds '>' before file extension. Note: put this inside determineName()? */ /* patch because twitter player preview adds '>' before file extension. */
if (uri.indexOf('>') !== -1) { if (uri.indexOf('>') !== -1) {
return uri.substring(0, uri.indexOf('>')); return uri.substring(0, uri.indexOf('>'));
} }