Skip to content

Commit

Permalink
extract mimeype from content-type for vaidation
Browse files Browse the repository at this point in the history
  • Loading branch information
berislavlopac committed Feb 2, 2022
1 parent d9a1efc commit b096977
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pyotr"
version = "0.6.0"
version = "0.7.0"
description = "Python OpenAPI-to-REST (and back) framework "
authors = ["Berislav Lopac <[email protected]>"]
license = "MIT"
Expand Down
3 changes: 2 additions & 1 deletion src/pyotr/validation/responses/starlette.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ class StarletteOpenAPIResponseFactory:
@classmethod
def create(cls, response):
"""Create Starlette response."""
mimetype, *_ = response.headers.get("content-type", "").split(";")
return OpenAPIResponse(
data=response.body,
status_code=response.status_code,
mimetype=response.headers.get("content-type"),
mimetype=mimetype,
)

0 comments on commit b096977

Please sign in to comment.