Messages further tuned.

This commit is contained in:
L. Kärkkäinen 2020-03-02 15:36:43 +02:00
parent 96a8b5c3a0
commit 85d58d7b2b

View File

@ -117,7 +117,7 @@ class Http:
break break
await self._receive_more() await self._receive_more()
if pos >= self.request_max_size: if pos >= self.request_max_size:
raise PayloadTooLarge("Request header too large") raise PayloadTooLarge("Request header exceeds the size limit")
# Parse header content # Parse header content
try: try:
reqline, *raw_headers = buf[:pos].decode().split("\r\n") reqline, *raw_headers = buf[:pos].decode().split("\r\n")
@ -348,7 +348,7 @@ class Http:
# Request size limit # Request size limit
if self.request_bytes > self.request_max_size: if self.request_bytes > self.request_max_size:
self.keep_alive = False self.keep_alive = False
raise PayloadTooLarge("Request body too large") raise PayloadTooLarge("Request body exceeds the size limit")
# End of request body? # End of request body?
if not self.request_bytes_left: if not self.request_bytes_left:
self.request_body = None self.request_body = None