File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,16 @@ def get_subscription_user_info(user: UserResponse) -> dict:
98
98
return Response (content = conf , media_type = "application/json" , headers = response_headers )
99
99
else :
100
100
conf = generate_subscription (user = user , config_format = "v2ray" , as_base64 = True )
101
+ return Response (content = conf , media_type = "text/plain" , headers = response_headers )
102
+
103
+ elif re .match ('^v2rayN/(\d+\.\d+)' , user_agent ):
104
+ version_str = re .match ('^v2rayN/(\d+\.\d+)' , user_agent ).group (1 )
105
+ if LooseVersion (version_str ) >= LooseVersion ("6.40" ):
106
+ conf = generate_subscription (user = user , config_format = "v2ray-json" , as_base64 = False )
101
107
return Response (content = conf , media_type = "application/json" , headers = response_headers )
108
+ else :
109
+ conf = generate_subscription (user = user , config_format = "v2ray" , as_base64 = True )
110
+ return Response (content = conf , media_type = "text/plain" , headers = response_headers )
102
111
103
112
else :
104
113
conf = generate_subscription (user = user , config_format = "v2ray" , as_base64 = True )
You can’t perform that action at this time.
0 commit comments