mirror of
https://github.com/fastapi-admin/fastapi-admin.git
synced 2026-03-13 10:32:25 +08:00
update example
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
from starlette.requests import Request
|
||||
|
||||
|
||||
def get_client_ip(request: Request):
|
||||
"""
|
||||
:param request:
|
||||
:return:
|
||||
"""
|
||||
forwarded = request.headers.get("X-Forwarded-For")
|
||||
if forwarded:
|
||||
return forwarded.split(",")[0]
|
||||
return request.client.host
|
||||
Reference in New Issue
Block a user