fix: 修复意外的检查逻辑 x2

This commit is contained in:
梓澄qwq 2024-04-21 20:02:20 +08:00 committed by GitHub
parent 9066a251a1
commit f1640760af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -71,7 +71,7 @@ async def handle_before_request(app, handler):
if (config.read_config('common.reverse_proxy.allow_proxy')):
if (request.headers.get(config.read_config('common.reverse_proxy.real_ip_header'))):
# proxy header
if ((not config.read_config('common.reverse_proxy.allow_public_ip')) and (not utils.is_local_ip(request.remote))):
if (config.read_config('common.reverse_proxy.allow_public_ip') or utils.is_local_ip(request.remote)):
request.remote_addr = request.headers.get(
config.read_config('common.reverse_proxy.real_ip_header'))
else: