From 0668ef606ba9ef2c94d3436d2de84927688fc54d Mon Sep 17 00:00:00 2001 From: bill bittner Date: Tue, 28 Nov 2017 13:26:48 -0800 Subject: [PATCH 1/2] patch to serve images on embedded show urls --- routes/serve-routes.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/routes/serve-routes.js b/routes/serve-routes.js index 3cde0875..cf54d19c 100644 --- a/routes/serve-routes.js +++ b/routes/serve-routes.js @@ -109,7 +109,11 @@ module.exports = (app) => { method = SERVE; } } else { - method = SHOW; + if (!headers['accept'] || !headers['accept'].split(',').includes('text/html')) { + method = SERVE; + } else { + method = SHOW; + } } /* patch for backwards compatability with spee.ch/name/claim_id */ if (isValidShortIdOrClaimId(name) && !isValidShortIdOrClaimId(identifier)) { @@ -226,6 +230,9 @@ module.exports = (app) => { logger.debug('file extension =', fileExtension); } else { method = SHOW; + if (!headers['accept'] || !headers['accept'].split(',').includes('text/html')) { + method = SERVE; + } } logger.debug('claim name = ', name); logger.debug('method =', method); -- 2.45.3 From 1734f20f019d4873c8b453e55b46d7a1a1f15b1c Mon Sep 17 00:00:00 2001 From: bill bittner Date: Tue, 28 Nov 2017 13:28:59 -0800 Subject: [PATCH 2/2] updated for consistency --- routes/serve-routes.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/routes/serve-routes.js b/routes/serve-routes.js index cf54d19c..eef33f93 100644 --- a/routes/serve-routes.js +++ b/routes/serve-routes.js @@ -109,10 +109,9 @@ module.exports = (app) => { method = SERVE; } } else { + method = SHOW; if (!headers['accept'] || !headers['accept'].split(',').includes('text/html')) { method = SERVE; - } else { - method = SHOW; } } /* patch for backwards compatability with spee.ch/name/claim_id */ -- 2.45.3