Add Cache-Control headers to output #1
| @ -86,7 +86,7 @@ async def root_get(ipaddress: Annotated[Union[IPv4Address,IPv6Address], | |||||||
|     ''' |     ''' | ||||||
|     Look up geolocation for ip in path parameter |     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: |     if locations: | ||||||
|         response.headers['Cache-Control'] = 'private, max-age=604800' |         response.headers['Cache-Control'] = 'private, max-age=604800' | ||||||
|         return locations.pop() |         return locations.pop() | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user