From 7db5b93806627a5175e058dc92c216fde6b795e4 Mon Sep 17 00:00:00 2001 From: "Juan Picado @jotadeveloper" Date: Mon, 18 Feb 2019 23:58:07 +0100 Subject: [PATCH 1/2] chore: fix logo 404 error --- src/api/web/index.js | 2 +- src/webui/components/Header/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/web/index.js b/src/api/web/index.js index 71bbfe863..05ee3c877 100644 --- a/src/api/web/index.js +++ b/src/api/web/index.js @@ -58,7 +58,7 @@ module.exports = function(config, auth, storage) { const webPage = template .replace(/ToReplaceByVerdaccio/g, base) .replace(/ToReplaceByTitle/g, _.get(config, 'web.title') ? config.web.title : WEB_TITLE) - .replace(/ToReplaceByLogo/g, _.get(config, 'web.logo') ? config.web.logo : null) + .replace(/ToReplaceByLogo/g, _.get(config, 'web.logo') ? config.web.logo : '') .replace(/ToReplaceByScope/g, _.get(config, 'web.scope') ? config.web.scope : ''); res.setHeader('Content-Type', 'text/html'); diff --git a/src/webui/components/Header/index.js b/src/webui/components/Header/index.js index 1b8c8bf6d..f1f1248d7 100644 --- a/src/webui/components/Header/index.js +++ b/src/webui/components/Header/index.js @@ -127,7 +127,7 @@ class Header extends Component { renderLogo = (): Node => { const { logo } = this.props; - if (logo) { + if (logo !== '') { return {'logo'}; } else { return ; From 28a50bfe081ceedd6aac0a94f93a098eba2ae2bb Mon Sep 17 00:00:00 2001 From: "Juan Picado @jotadeveloper" Date: Tue, 19 Feb 2019 07:04:39 +0100 Subject: [PATCH 2/2] chore: fix router issue --- src/api/web/index.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/api/web/index.js b/src/api/web/index.js index 05ee3c877..559cdda8c 100644 --- a/src/api/web/index.js +++ b/src/api/web/index.js @@ -12,7 +12,6 @@ import express from 'express'; import { combineBaseUrl, getWebProtocol } from '../../lib/utils'; import Search from '../../lib/search'; import { HEADERS, HTTP_STATUS, WEB_TITLE } from '../../lib/constants'; -import { spliceURL } from '../../utils/string'; const { securityIframe } = require('../middleware'); /* eslint new-cap:off */ @@ -66,16 +65,10 @@ module.exports = function(config, auth, storage) { res.send(webPage); } - router.get('/-/web/:pkg', function(req, res) { + router.get('/-/web/:section/*', function(req, res) { renderHTML(req, res); }); - router.get('/-/verdaccio/logo', function(req, res) { - const installPath = _.get(config, 'url_prefix', ''); - - res.send(_.get(config, 'web.logo') || spliceURL(installPath, '/-/static/logo.png')); - }); - router.get('/', function(req, res) { renderHTML(req, res); });