mirror of
https://github.com/correl/tornado-openapi3.git
synced 2024-11-23 11:09:56 +00:00
Merge pull request #6 from in-op/no-body
Use None for no request body instead of b""
This commit is contained in:
commit
6de69fc771
2 changed files with 3 additions and 3 deletions
|
@ -99,7 +99,7 @@ class TestRequestFactory(unittest.TestCase):
|
||||||
full_url_pattern=url,
|
full_url_pattern=url,
|
||||||
method="get",
|
method="get",
|
||||||
parameters=RequestParameters(query=ImmutableMultiDict(parameters)),
|
parameters=RequestParameters(query=ImmutableMultiDict(parameters)),
|
||||||
body=b"",
|
body=None,
|
||||||
mimetype="application/x-www-form-urlencoded",
|
mimetype="application/x-www-form-urlencoded",
|
||||||
)
|
)
|
||||||
openapi_request = TornadoRequestFactory.create(tornado_request)
|
openapi_request = TornadoRequestFactory.create(tornado_request)
|
||||||
|
@ -127,7 +127,7 @@ class TestRequestFactory(unittest.TestCase):
|
||||||
parameters=RequestParameters(
|
parameters=RequestParameters(
|
||||||
query=ImmutableMultiDict(parameters), path={}, cookie={}
|
query=ImmutableMultiDict(parameters), path={}, cookie={}
|
||||||
),
|
),
|
||||||
body=b"",
|
body=None,
|
||||||
mimetype="application/x-www-form-urlencoded",
|
mimetype="application/x-www-form-urlencoded",
|
||||||
)
|
)
|
||||||
openapi_request = TornadoRequestFactory.create(tornado_request)
|
openapi_request = TornadoRequestFactory.create(tornado_request)
|
||||||
|
|
|
@ -55,7 +55,7 @@ class TornadoRequestFactory:
|
||||||
header=Headers(request.headers.get_all()),
|
header=Headers(request.headers.get_all()),
|
||||||
cookie=parse_cookie(request.headers.get("Cookie", "")),
|
cookie=parse_cookie(request.headers.get("Cookie", "")),
|
||||||
),
|
),
|
||||||
body=request.body if request.body else b"",
|
body=request.body if request.body else None,
|
||||||
mimetype=parse_mimetype(
|
mimetype=parse_mimetype(
|
||||||
request.headers.get("Content-Type", "application/x-www-form-urlencoded")
|
request.headers.get("Content-Type", "application/x-www-form-urlencoded")
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue