mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Handling undefined hostname
This commit is contained in:
@@ -11,7 +11,12 @@ module.exports = function (options) {
|
||||
}
|
||||
|
||||
const ip = req.headers['cf-connecting-ip'] || req.connection.remoteAddress
|
||||
const hostname = req.hostname.replace('www.', '').split('.')[0]
|
||||
let hostname = 'UNDEF'
|
||||
if (req.hostname) {
|
||||
hostname = req.hostname.replace('www.', '').split('.')[0]
|
||||
} else {
|
||||
logger.Log('Hostname is undefined!', logger.GetColor('redbg'))
|
||||
}
|
||||
|
||||
// fixme: regexp includes checking
|
||||
const hasLoggableKeyword = loggableKeywords && loggableKeywords.some((x) => {
|
||||
|
Reference in New Issue
Block a user