当前位置: 萬仟网 > IT编程>网页制作>CSS > aiohttp上报:Got more than 8190 bytes (10160) when reading Status line is too long.错误的解决办法

aiohttp上报:Got more than 8190 bytes (10160) when reading Status line is too long.错误的解决办法

2019年09月10日 17:20  | 萬仟网IT编程  | 我要评论

通过浏览器向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的值

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

◎已有 0 人评论

Copyright © 2019  萬仟网 保留所有权利. 粤ICP备17035492号-1
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com