Last active
June 12, 2025 23:37
-
-
Save t0rr3sp3dr0/083d4f1bcf081498517f1834f7bb1e30 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mitmproxy import http | |
src = 'ax.init.itunes.apple.com' | |
dst = 'init.itunes.apple.com' | |
def request(flow: http.HTTPFlow) -> None: | |
if flow.request.pretty_host in (src, src + '.'): | |
flow.request.host = dst | |
def response(flow: http.HTTPFlow): | |
if 'Location' in flow.response.headers and dst in flow.response.headers['Location']: | |
flow.response.headers['Location'] = flow.response.headers['Location'].replace(dst, src) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment