mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2025-02-01 15:55:28 +00:00
Merge pull request #3996 from MrNbaYoh/master
First step to fix #848 by adding a relax_http_form_validation option.
This commit is contained in:
commit
ac7f05efe9
@ -181,5 +181,11 @@ class Options(optmanager.OptManager):
|
||||
TLS key size for certificates and CA.
|
||||
"""
|
||||
)
|
||||
self.add_option(
|
||||
"relax_http_form_validation", bool, False,
|
||||
"""
|
||||
Disable HTTP form validation.
|
||||
"""
|
||||
)
|
||||
|
||||
self.update(**kwargs)
|
||||
|
@ -281,10 +281,12 @@ class HttpLayer(base.Layer):
|
||||
self.send_error_response(400, msg)
|
||||
return False
|
||||
|
||||
validate_request_form(self.mode, request)
|
||||
if not self.config.options.relax_http_form_validation:
|
||||
validate_request_form(self.mode, request)
|
||||
self.channel.ask("requestheaders", f)
|
||||
# Re-validate request form in case the user has changed something.
|
||||
validate_request_form(self.mode, request)
|
||||
if not self.config.options.relax_http_form_validation:
|
||||
validate_request_form(self.mode, request)
|
||||
|
||||
if request.headers.get("expect", "").lower() == "100-continue":
|
||||
# TODO: We may have to use send_response_headers for HTTP2
|
||||
|
Loading…
Reference in New Issue
Block a user