Skip to content

Instantly share code, notes, and snippets.

@alexandru
Created May 10, 2018 08:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexandru/f68bc29aac2e4961f7720ecfba63afd3 to your computer and use it in GitHub Desktop.
Save alexandru/f68bc29aac2e4961f7720ecfba63afd3 to your computer and use it in GitHub Desktop.
from aiohttp import http
from aiohttp import http_parser
from aiohttp.http_parser import HttpResponseParser, HttpRequestParser
from aiohttp import client_proto
HttpResponseParserOrig = HttpResponseParser
HttpRequestParserOrig = HttpRequestParser
class HttpResponseParser(HttpResponseParserOrig):
def __init__(self, *args, **kwargs):
kwargs['max_line_size'] = 20000
kwargs['max_field_size'] = 20000
super(HttpResponseParser, self).__init__(*args, **kwargs)
class HttpRequestParser(HttpRequestParserOrig):
def __init__(self, *args, **kwargs):
kwargs['max_line_size'] = 20000
kwargs['max_field_size'] = 20000
super(HttpRequestParser, self).__init__(*args, **kwargs)
http.HttpRequestParser = HttpRequestParser
http_parser.HttpRequestParser = HttpRequestParser
client_proto.HttpRequestParser = HttpRequestParser
http.HttpResponseParser = HttpResponseParser
http_parser.HttpResponseParser = HttpResponseParser
client_proto.HttpResponseParser = HttpResponseParser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment