def _set_response_attributes_from_endpoint(response: falcon.Response, endpoint: Endpoint):
response.status = getattr(falcon, f"HTTP_{endpoint.status}")
response.body = endpoint.body
if endpoint.content_type:
response.content_type = endpoint.content_type
for header_name, header_value in endpoint.headers.items():
response.set_header(header_name, header_value)
for cookie_name, cookie_value in endpoint.cookies.items():
response.set_cookie(cookie_name, cookie_value)
评论列表
文章目录