cleaned up logging
This commit is contained in:
parent
a6cbb79921
commit
76e618f2ac
2 changed files with 4 additions and 6 deletions
|
@ -113,7 +113,6 @@ module.exports = {
|
||||||
const filteredClaimsList = claims.filter(claim => {
|
const filteredClaimsList = claims.filter(claim => {
|
||||||
return regex.test(claim.claim_id);
|
return regex.test(claim.claim_id);
|
||||||
});
|
});
|
||||||
logger.debug('filtered claims list', filteredClaimsList);
|
|
||||||
switch (filteredClaimsList.length) {
|
switch (filteredClaimsList.length) {
|
||||||
case 0:
|
case 0:
|
||||||
reject(new Error('That is an invalid short url'));
|
reject(new Error('That is an invalid short url'));
|
||||||
|
|
|
@ -93,8 +93,8 @@ module.exports = (app) => {
|
||||||
// parse the name
|
// parse the name
|
||||||
const positionOfExtension = name.indexOf('.');
|
const positionOfExtension = name.indexOf('.');
|
||||||
if (positionOfExtension >= 0) {
|
if (positionOfExtension >= 0) {
|
||||||
name = name.substring(0, positionOfExtension);
|
|
||||||
extension = name.substring(positionOfExtension);
|
extension = name.substring(positionOfExtension);
|
||||||
|
name = name.substring(0, positionOfExtension);
|
||||||
logger.debug('file extension =', extension);
|
logger.debug('file extension =', extension);
|
||||||
if (headers['accept'] && headers['accept'].split(',').includes('text/html')) {
|
if (headers['accept'] && headers['accept'].split(',').includes('text/html')) {
|
||||||
method = SHOWLITE;
|
method = SHOWLITE;
|
||||||
|
@ -116,7 +116,6 @@ module.exports = (app) => {
|
||||||
}
|
}
|
||||||
/* end */
|
/* end */
|
||||||
logger.debug('claim name =', name);
|
logger.debug('claim name =', name);
|
||||||
logger.debug('identifiery =', identifier);
|
|
||||||
logger.debug('method =', method);
|
logger.debug('method =', method);
|
||||||
// parse identifier for whether it is a channel, short url, or claim_id
|
// parse identifier for whether it is a channel, short url, or claim_id
|
||||||
if (identifier.charAt(0) === '@') {
|
if (identifier.charAt(0) === '@') {
|
||||||
|
@ -159,15 +158,15 @@ module.exports = (app) => {
|
||||||
// parse name param
|
// parse name param
|
||||||
let name = params.name;
|
let name = params.name;
|
||||||
let method;
|
let method;
|
||||||
let desiredExtension;
|
let fileExtension;
|
||||||
if (name.indexOf('.') !== -1) {
|
if (name.indexOf('.') !== -1) {
|
||||||
method = SERVE;
|
method = SERVE;
|
||||||
if (headers['accept'] && headers['accept'].split(',').includes('text/html')) {
|
if (headers['accept'] && headers['accept'].split(',').includes('text/html')) {
|
||||||
method = SHOWLITE;
|
method = SHOWLITE;
|
||||||
}
|
}
|
||||||
desiredExtension = name.substring(name.indexOf('.'));
|
fileExtension = name.substring(name.indexOf('.'));
|
||||||
name = name.substring(0, name.indexOf('.'));
|
name = name.substring(0, name.indexOf('.'));
|
||||||
logger.debug('file extension =', desiredExtension);
|
logger.debug('file extension =', fileExtension);
|
||||||
} else {
|
} else {
|
||||||
method = SHOW;
|
method = SHOW;
|
||||||
if (headers['accept'] && !headers['accept'].split(',').includes('text/html')) {
|
if (headers['accept'] && !headers['accept'].split(',').includes('text/html')) {
|
||||||
|
|
Loading…
Reference in a new issue