mirror of
https://github.com/MatthewL246/mitmproxy-pretendo.git
synced 2026-04-25 15:57:57 -05:00
Update addon script to work with reverse proxy
Use `pretty_host` instead of `host` because `pretty_host` takes the HTTP host header into account, not just the destination.
This commit is contained in:
parent
29aa07cf4e
commit
c4120b7781
|
|
@ -19,9 +19,9 @@ class PretendoAddon:
|
|||
|
||||
def request(self, flow: http.HTTPFlow) -> None:
|
||||
if ctx.options.pretendo_redirect:
|
||||
if 'nintendo.net' in flow.request.host:
|
||||
flow.request.host = flow.request.host.replace('nintendo.net', 'pretendo.cc')
|
||||
|
||||
if 'nintendo.net' in flow.request.pretty_host:
|
||||
flow.request.host = flow.request.pretty_host.replace('nintendo.net', 'pretendo.cc')
|
||||
|
||||
if ctx.options.pretendo_http:
|
||||
flow.request.scheme = 'http'
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user