mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 10:16:27 +00:00
Update redirect_requests.py
replace http version with "HTTP/1.1"
This commit is contained in:
parent
11215e46ec
commit
27b801ebe2
@ -12,11 +12,11 @@ def request(context, flow):
|
|||||||
# Method 1: Answer with a locally generated response
|
# Method 1: Answer with a locally generated response
|
||||||
if flow.request.pretty_host.endswith("example.com"):
|
if flow.request.pretty_host.endswith("example.com"):
|
||||||
resp = HTTPResponse(
|
resp = HTTPResponse(
|
||||||
[1, 1], 200, "OK",
|
"HTTP/1.1", 200, "OK",
|
||||||
Headers(Content_Type="text/html"),
|
Headers(Content_Type="text/html"),
|
||||||
"helloworld")
|
"helloworld")
|
||||||
flow.reply(resp)
|
flow.reply(resp)
|
||||||
|
|
||||||
# Method 2: Redirect the request to a different server
|
# Method 2: Redirect the request to a different server
|
||||||
if flow.request.pretty_host.endswith("example.org"):
|
if flow.request.pretty_host.endswith("example.org"):
|
||||||
flow.request.host = "mitmproxy.org"
|
flow.request.host = "mitmproxy.org"
|
||||||
|
Loading…
Reference in New Issue
Block a user