From a6ccc9b682349ebc95a96a24604345ee5166db3c Mon Sep 17 00:00:00 2001 From: bill bittner Date: Wed, 29 Nov 2017 14:36:51 -0800 Subject: [PATCH] added fix to serve to embeded show urls --- helpers/lbryApi.js | 2 +- routes/serve-routes.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/helpers/lbryApi.js b/helpers/lbryApi.js index 3da72a05..0474ca36 100644 --- a/helpers/lbryApi.js +++ b/helpers/lbryApi.js @@ -6,7 +6,7 @@ function handleLbrynetResponse ({ data }, resolve, reject) { if (data.result) { // check for an 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); return; }; diff --git a/routes/serve-routes.js b/routes/serve-routes.js index 43aced6e..fd45f3be 100644 --- a/routes/serve-routes.js +++ b/routes/serve-routes.js @@ -152,12 +152,15 @@ function determineResponseType (uri, headers) { } } else { responseType = SHOW; + if (!headers['accept'] || !headers['accept'].split(',').includes('text/html')) { + responseType = SERVE; + } } return responseType; } 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) { return uri.substring(0, uri.indexOf('>')); }