mirror of
https://github.com/correl/tornado-openapi3.git
synced 2024-11-22 03:00:15 +00:00
Get mimetype from header
This commit is contained in:
parent
aa9e595fa9
commit
e80db27aa9
2 changed files with 4 additions and 2 deletions
|
@ -89,7 +89,7 @@ class TestRequestFactory(unittest.TestCase):
|
|||
method="get",
|
||||
parameters=RequestParameters(query=ImmutableMultiDict([("bar", "baz")])),
|
||||
body="",
|
||||
mimetype="text/html",
|
||||
mimetype="application/x-www-form-urlencoded",
|
||||
)
|
||||
openapi_request = TornadoRequestFactory.create(tornado_request)
|
||||
self.assertEqual(attr.asdict(expected), attr.asdict(openapi_request))
|
||||
|
|
|
@ -30,5 +30,7 @@ class TornadoRequestFactory:
|
|||
query=query_arguments, header=Headers(request.headers.get_all())
|
||||
),
|
||||
body=request.body.decode("utf-8"),
|
||||
mimetype="text/html",
|
||||
mimetype=request.headers.get(
|
||||
"Content-Type", "application/x-www-form-urlencoded"
|
||||
),
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue