Skip to content

Commit

Permalink
fix vless short id check error
Browse files Browse the repository at this point in the history
  • Loading branch information
wzdnzd committed Jun 15, 2024
1 parent fa4672d commit 1854c0d
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions subscribe/clash.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,12 +442,18 @@ def verify(item: dict, meta: bool = True) -> bool:
return False
if "public-key" not in reality_opts or type(reality_opts["public-key"]) != str:
return False
if "short-id" in reality_opts and (
type(reality_opts["short-id"]) != str
or len(reality_opts["short-id"]) != 8
or not is_hex(reality_opts["short-id"])
):
return False
if "short-id" in reality_opts:
short_id = reality_opts["short-id"]
if type(short_id) != str:
if utils.is_number(short_id):
short_id = str(short_id)
else:
return False

if len(short_id) != 8 or not is_hex(short_id):
return False

reality_opts["short-id"] = short_id
elif item["type"] == "tuic":
# see: https://wiki.metacubex.one/config/proxies/tuic

Expand Down

0 comments on commit 1854c0d

Please sign in to comment.