mirror of
https://github.com/correl/tornado-openapi3.git
synced 2024-12-28 19:19:22 +00:00
Handle unset response bodies
This commit is contained in:
parent
2b2b423b7b
commit
98d112369f
1 changed files with 1 additions and 1 deletions
|
@ -13,7 +13,7 @@ class TornadoResponseFactory:
|
|||
def create(cls, response: HTTPResponse) -> OpenAPIResponse:
|
||||
mimetype = response.headers.get("Content-Type", "text/html")
|
||||
return OpenAPIResponse(
|
||||
data=response.body.decode("utf-8"),
|
||||
data=response.body.decode("utf-8") if response.body else "",
|
||||
status_code=response.code,
|
||||
mimetype=mimetype,
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue