diff --git a/server/controllers/assets/serveByClaim/index.js b/server/controllers/assets/serveByClaim/index.js index 208bc46a..fdabdc96 100644 --- a/server/controllers/assets/serveByClaim/index.js +++ b/server/controllers/assets/serveByClaim/index.js @@ -16,6 +16,16 @@ const { SHOW } = require('../constants/request_types.js'); const serveByClaim = (req, res) => { const { headers, ip, originalUrl, params } = req; + // return early if channel request + let isChannel = false; + try { + ({ isChannel } = lbryUri.parseIdentifier(params.claim)); + } catch (error) { + return res.status(400).json({success: false, message: error.message}); + } + if (isChannel) { + return handleShowRender(req, res); + } // decide if this is a show request let hasFileExtension; try { diff --git a/server/controllers/assets/utils/determineRequestType.js b/server/controllers/assets/utils/determineRequestType.js index 4ca2b4ed..e3ee5448 100644 --- a/server/controllers/assets/utils/determineRequestType.js +++ b/server/controllers/assets/utils/determineRequestType.js @@ -8,10 +8,13 @@ function clientWantsAsset ({accept, range}) { } const determineRequestType = (hasFileExtension, headers) => { + logger.debug('hasFileExtension:', hasFileExtension); logger.debug('headers:', headers); if (hasFileExtension || clientWantsAsset(headers)) { + logger.debug('client wants direct asset'); return EMBED; } + logger.debug('client wants show page'); return SHOW; };