From af5b44be473ecdb3c78f78cb8436b7975c1ba340 Mon Sep 17 00:00:00 2001 From: bill bittner Date: Tue, 8 Aug 2017 15:41:14 -0700 Subject: [PATCH] added patch for twitter player card url addition --- routes/serve-routes.js | 7 ++++++- views/embed.handlebars | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/routes/serve-routes.js b/routes/serve-routes.js index f42bd1c5..e1eb3875 100644 --- a/routes/serve-routes.js +++ b/routes/serve-routes.js @@ -86,6 +86,11 @@ module.exports = (app) => { if (positionOfExtension >= 0) { extension = name.substring(positionOfExtension); name = name.substring(0, positionOfExtension); + /* patch because twitter player preview adds '>' before file extension */ + if (name.indexOf('>') >= 0) { + name = name.substring(0, name.indexOf('>')); + } + /* end patch */ logger.debug('file extension =', extension); if (headers['accept'] && headers['accept'].split(',').includes('text/html')) { method = SHOWLITE; @@ -95,7 +100,7 @@ module.exports = (app) => { } else { method = SHOW; } - /* start: temporary patch for backwards compatability spee.ch/name/claim_id */ + /* patch for backwards compatability with spee.ch/name/claim_id */ if (isValidShortUrlOrClaimId(name) && !isValidShortUrlOrClaimId(identifier)) { let tempName = name; name = identifier; diff --git a/views/embed.handlebars b/views/embed.handlebars index 28c85194..e28d7cbf 100644 --- a/views/embed.handlebars +++ b/views/embed.handlebars @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file