dane w headerach i inne funkcje
This commit is contained in:
@@ -6,6 +6,7 @@ from .geo import reload_provider
|
||||
import secrets
|
||||
import ipaddress
|
||||
import re
|
||||
import json
|
||||
|
||||
router = APIRouter()
|
||||
security = HTTPBasic()
|
||||
@@ -169,6 +170,7 @@ async def my_ip(request: Request, geo=Depends(get_geo)):
|
||||
body = json.dumps(data, ensure_ascii=False) + "\n"
|
||||
return Response(content=body, media_type="application/json", headers=headers)
|
||||
|
||||
|
||||
@router.api_route('/ip/{ip_address}', methods=["GET", "HEAD"])
|
||||
async def ip_lookup(ip_address: str, geo=Depends(get_geo)):
|
||||
data = geo.lookup(ip_address)
|
||||
|
Reference in New Issue
Block a user