Serve image to embedded show urls #276

Merged
bones7242 merged 2 commits from serve-image-to-embedded-show-urls into master 2017-11-28 22:37:11 +01:00

View file

@ -110,6 +110,9 @@ module.exports = (app) => {
} }
} else { } else {
method = SHOW; method = SHOW;
if (!headers['accept'] || !headers['accept'].split(',').includes('text/html')) {
method = SERVE;
}
} }
/* patch for backwards compatability with spee.ch/name/claim_id */ /* patch for backwards compatability with spee.ch/name/claim_id */
if (isValidShortIdOrClaimId(name) && !isValidShortIdOrClaimId(identifier)) { if (isValidShortIdOrClaimId(name) && !isValidShortIdOrClaimId(identifier)) {
@ -226,6 +229,9 @@ module.exports = (app) => {
logger.debug('file extension =', fileExtension); logger.debug('file extension =', fileExtension);
} else { } else {
method = SHOW; method = SHOW;
if (!headers['accept'] || !headers['accept'].split(',').includes('text/html')) {
method = SERVE;
}
} }
logger.debug('claim name = ', name); logger.debug('claim name = ', name);
logger.debug('method =', method); logger.debug('method =', method);