diff --git a/app.js b/app.js index 4c4f9859..041c94bc 100644 --- a/app.js +++ b/app.js @@ -57,7 +57,7 @@ const server = require('./server') global.port = config.port global.proxy = config.proxyUrl ? parse(config.proxyUrl) : null global.hosts = {}, hook.target.host.forEach(host => global.hosts[host] = config.forceHost) -config.strict ? server.whitelist = ['music.163.com', 'music.126.net', 'vod.126.net'] : server.blanklist = [] +config.strict ? server.whitelist = ['music.163.com', 'music.126.net', 'vod.126.net', 'localhost'] : server.blacklist = [] server.authentication = config.token || null global.endpoint = config.endpoint diff --git a/server.js b/server.js index da7d08c0..4fc73452 100644 --- a/server.js +++ b/server.js @@ -75,7 +75,7 @@ const proxy = { let allow = server.whitelist.some(match) let deny = server.blacklist.some(match) // console.log('allow', allow, 'deny', deny) - if(!allow && deny){ + if(!allow || deny){ return Promise.reject(ctx.error = 'filter') } } @@ -171,7 +171,7 @@ const server = { } server.whitelist = ['.*'] -server.blacklist = ['.*'] +server.blacklist = [] server.authentication = null module.exports = server \ No newline at end of file