fix: 修复允许公网转发时报错

Close #51
This commit is contained in:
梓澄qwq 2024-04-16 01:49:22 +08:00 committed by GitHub
parent acb84a5cb9
commit 2463660e90
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 (config.read_config('common.reverse_proxy.allow_public_ip') and (not utils.is_private_ip(request.remote))):
if (config.read_config('common.reverse_proxy.allow_public_ip') and (not utils.is_local_ip(request.remote))):
request.remote_addr = request.headers.get(
config.read_config('common.reverse_proxy.real_ip_header'))
else: