Call get_routes_as_head only on HEAD requests.