aiohttp上报:Got more than 8190 bytes (10160) when reading Status line is too long.错误的解决办法
通过浏览器向web服务传递base64码的图片时遇到参数过长的问题?
解决办法:查看aiohttp的源码:aiohttp/http_parser.py下找到:
class headersparser:
def __init__(self,
max_line_size: int=8190,
max_headers: int=32768,
max_field_size: int=8190) -> none:
self.max_line_size = max_line_size
self.max_headers = max_headers
self.max_field_size = max_field_size
修改为:
class headersparser:
def __init__(self,
max_line_size: int=81900,
max_headers: int=32768,
max_field_size: int=81900) -> none:
self.max_line_size = max_line_size
self.max_headers = max_headers
self.max_field_size = max_field_size
def parse_headers(
self,
lines: list[bytes]
) -> tuple['cimultidictproxy[str]', rawheaders]:
headers = cimultidict() # type: cimultidict[str]
raw_headers = []
lines_idx = 1
line = lines[1]
line_count = len(lines)
def parse_headers(
self,
lines: list[bytes]
) -> tuple['cimultidictproxy[str]', rawheaders]:
headers = cimultidict() # type: cimultidict[str]
raw_headers = []
lines_idx = 1
line = lines[1]
line_count = len(lines)
可以按照自己想要的长度修改max_field_size和max_line_size的值