initial commit
This commit is contained in:
commit
94a278dbd4
6 changed files with 581 additions and 0 deletions
19
redirect.py
Normal file
19
redirect.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
from mitmproxy import http
|
||||
|
||||
class ObsidianRedirect:
|
||||
def request(self, flow: http.HTTPFlow) -> None:
|
||||
#return
|
||||
if flow.request.pretty_host == "sync-32.obsidian.md":
|
||||
flow.request.scheme = "http"
|
||||
flow.request.host = "localhost"
|
||||
flow.request.port = 5000
|
||||
flow.request.headers["Host"] = "sync-32.obsidian.md"
|
||||
|
||||
if flow.request.pretty_host == "api.obsidian.md":
|
||||
flow.request.scheme = "http"
|
||||
flow.request.host = "localhost"
|
||||
flow.request.port = 5000
|
||||
|
||||
flow.request.headers["Host"] = "api.obsidian.md"
|
||||
|
||||
addons = [ObsidianRedirect()]
|
Loading…
Add table
Add a link
Reference in a new issue