Skip to content

Commit

Permalink
log raw request (#418)
Browse files Browse the repository at this point in the history
  • Loading branch information
djstrong authored Sep 26, 2024
1 parent 940f03a commit 28bb911
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions api/nameguard/web_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
init_time = time.time()

from enum import Enum
from fastapi import FastAPI, Path
from fastapi import FastAPI, Path, Request
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel, Field

Expand Down Expand Up @@ -489,7 +489,7 @@ async def inspect_labelhash_post(request: InspectLabelhashRequest) -> NameGuardR
},
)
async def secure_primary_name_get(
address: str, network_name: NetworkName, return_nameguard_report: bool = False
address: str, network_name: NetworkName, request: Request, return_nameguard_report: bool = False
) -> SecurePrimaryNameResult:
"""
## Performs a reverse lookup of an Ethereum `address` to a primary name.
Expand All @@ -505,6 +505,9 @@ async def secure_primary_name_get(
logger.debug(
f"{json.dumps({'endpoint': Endpoints.SECURE_PRIMARY_NAME, 'method': 'GET', 'network_name': network_name, 'address': address, 'return_nameguard_report': return_nameguard_report})}"
)
logger.debug(f'Request headers: {dict(request.headers)}')
logger.debug(f'Request query params: {dict(request.query_params)}')
logger.debug(f'Request path params: {dict(request.path_params)}')
nameguard.context.endpoint_name.set(Endpoints.SECURE_PRIMARY_NAME)
address = validate_ethereum_address(address)

Expand Down

0 comments on commit 28bb911

Please sign in to comment.