mirror of
https://github.com/masterking32/MasterHttpRelayVPN.git
synced 2026-05-18 23:54:37 +03:00
Fix: x.com loading issues
Shorten X API URLs for relay error prevention.
This commit is contained in:
+5
-1
@@ -951,7 +951,11 @@ class ProxyServer:
|
|||||||
if b":" in raw_line:
|
if b":" in raw_line:
|
||||||
k, v = raw_line.decode(errors="replace").split(":", 1)
|
k, v = raw_line.decode(errors="replace").split(":", 1)
|
||||||
headers[k.strip()] = v.strip()
|
headers[k.strip()] = v.strip()
|
||||||
|
|
||||||
|
# Shortening the length of X API URLs to prevent relay errors.
|
||||||
|
if host == "x.com" and re.match(r"/i/api/graphql/[^/]+/[^?]+\?variables=", path):
|
||||||
|
path = path.split("&")[0]
|
||||||
|
|
||||||
# MITM traffic arrives as origin-form paths; SOCKS/plain HTTP can
|
# MITM traffic arrives as origin-form paths; SOCKS/plain HTTP can
|
||||||
# also send absolute-form requests. Normalize both to full URLs.
|
# also send absolute-form requests. Normalize both to full URLs.
|
||||||
if path.startswith("http://") or path.startswith("https://"):
|
if path.startswith("http://") or path.startswith("https://"):
|
||||||
|
|||||||
Reference in New Issue
Block a user