Merge pull request #6 from in-op/no-body

Use None for no request body instead of b""
This commit is contained in:
Correl Roush 2024-08-05 11:03:41 -04:00 committed by GitHub
commit 6de69fc771
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -99,7 +99,7 @@ class TestRequestFactory(unittest.TestCase):
full_url_pattern=url,
method="get",
parameters=RequestParameters(query=ImmutableMultiDict(parameters)),
body=b"",
body=None,
mimetype="application/x-www-form-urlencoded",
)
openapi_request = TornadoRequestFactory.create(tornado_request)
@ -127,7 +127,7 @@ class TestRequestFactory(unittest.TestCase):
parameters=RequestParameters(
query=ImmutableMultiDict(parameters), path={}, cookie={}
),
body=b"",
body=None,
mimetype="application/x-www-form-urlencoded",
)
openapi_request = TornadoRequestFactory.create(tornado_request)

View file

@ -55,7 +55,7 @@ class TornadoRequestFactory:
header=Headers(request.headers.get_all()),
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(
request.headers.get("Content-Type", "application/x-www-form-urlencoded")
),