Use getHostFromUrl for error log

afe29c61cc8597d263bf1e90494731ca27fafa6f

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +1 -2Showing whitespace changes
src/endpoints/content-manager.js+1 -2
@@ -710,8 +710,7 @@ router.post('/importURL', async (request, response) => {
710710 type = 'character';
711711 result = await downloadGenericPng(url);
712712 } else {
713- const receivedURL = new URL(url);
713+ console.error(`Received an import for "${getHostFromUrl(url)}", but site is not whitelisted. This domain must be added to the config key "whitelistImportDomains" to allow import from this source.`);
714- console.error(`Received an import for "${receivedURL.host}", but site is not whitelisted. This domain must be added to the config key "whitelistImportDomains" to allow import from this source.`);
715714 return response.sendStatus(404);
716715 }
717716