diff --git a/routes/serve-routes.js b/routes/serve-routes.js index 3cde0875..eef33f93 100644 --- a/routes/serve-routes.js +++ b/routes/serve-routes.js @@ -110,6 +110,9 @@ module.exports = (app) => { } } else { method = SHOW; + if (!headers['accept'] || !headers['accept'].split(',').includes('text/html')) { + method = SERVE; + } } /* patch for backwards compatability with spee.ch/name/claim_id */ if (isValidShortIdOrClaimId(name) && !isValidShortIdOrClaimId(identifier)) { @@ -226,6 +229,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);