Skip to content

Commit

Permalink
fix: don't include fragment in links if it's empty
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintShit committed May 19, 2024
1 parent 43a669c commit 1ed5ec5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions app/subscription/v2ray.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,16 @@ def vmess(
"net": net,
"path": path,
"port": port,
"fragment": fs,
"ps": remark,
"scy": "auto",
"tls": tls,
"type": type,
"v": "2",
}

if fs:
payload["fragment"] = fs

if tls == "tls":
payload["sni"] = sni
payload["fp"] = fp
Expand Down Expand Up @@ -111,7 +113,8 @@ def vless(cls,
payload["sni"] = sni
payload["fp"] = fp
payload["alpn"] = alpn
payload["fragment"] = fs
if fs:
payload["fragment"] = fs
if ais:
payload["allowInsecure"] = 1
elif tls == "reality":
Expand Down Expand Up @@ -172,7 +175,8 @@ def trojan(cls,
payload["sni"] = sni
payload["fp"] = fp
payload["alpn"] = alpn
payload["fragment"] = fs
if fs:
payload["fragment"] = fs
if ais:
payload["allowInsecure"] = 1
elif tls == "reality":
Expand Down Expand Up @@ -266,7 +270,7 @@ def ws_config(path=None, host=None):
wsSettings["headers"]["Host"] = host

return wsSettings

@staticmethod
def httpupgrade_config(path=None, host=None):

Expand Down Expand Up @@ -316,7 +320,6 @@ def tcp_http_config(path=None, host=None):
if host:
tcpSettings["header"]["request"]["headers"]["Host"] = [host]


return tcpSettings

@staticmethod
Expand Down

0 comments on commit 1ed5ec5

Please sign in to comment.