Add Cache-Control headers to output #1

Merged
ruben merged 3 commits from cache_control into main 2024-05-07 15:16:46 +00:00
Showing only changes of commit 878a2b6bbf - Show all commits

View File

@ -86,7 +86,7 @@ async def root_get(ipaddress: Annotated[Union[IPv4Address,IPv6Address],
'''
Look up geolocation for ip in path parameter
'''
locations = await root_post([IPAddressParam(ip=ipaddress)])
locations = await root_post([IPAddressParam(ip=ipaddress)], response)
if locations:
response.headers['Cache-Control'] = 'private, max-age=604800'
return locations.pop()