This commit is contained in:
2018-10-14 06:27:13 -04:00
parent 6cb4a0a3eb
commit a2ae3ffb2b
+5
View File
@@ -134,10 +134,15 @@ class Request:
@property
async def encoding(self):
"""The encoding of the Request's body. Can be set, manually. Must be awaited."""
# Use the user-set encoding first.
if self._encoding:
return self._encoding
# Then try what's defined by the Request.
elif await self.declared_encoding:
return self.declared_encoding
# Then, automatically detect the encoding.
else:
return await self.apparent_encoding