feat(api/auth): switch-to-stateful-authentication (#5438)

This commit is contained in:
-LAN- 2024-06-21 12:39:07 +08:00 committed by GitHub
commit 1336b844fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 89 additions and 43 deletions

View file

@ -140,7 +140,7 @@ def generate_string(n):
return result
def get_remote_ip(request):
def get_remote_ip(request) -> str:
if request.headers.get('CF-Connecting-IP'):
return request.headers.get('Cf-Connecting-Ip')
elif request.headers.getlist("X-Forwarded-For"):