initial commit

This commit is contained in:
Mathias DUPEUX 2025-04-17 15:07:44 +02:00
commit 94a278dbd4
6 changed files with 581 additions and 0 deletions

19
redirect.py Normal file
View 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()]