From e481860075d874ac5d99d12c9089c148f4feab06 Mon Sep 17 00:00:00 2001 From: Charlie Qiu Date: Fri, 20 Jan 2017 16:10:11 +0800 Subject: [PATCH] [BUG] Fix #215 --- ShadowsocksX-NG/ServerProfile.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ShadowsocksX-NG/ServerProfile.swift b/ShadowsocksX-NG/ServerProfile.swift index 8b2ec4a3..cfc4be3d 100644 --- a/ShadowsocksX-NG/ServerProfile.swift +++ b/ShadowsocksX-NG/ServerProfile.swift @@ -56,7 +56,8 @@ class ServerProfile: NSObject, NSCopying { guard let decoded = String(data: data, encoding: String.Encoding.utf8) else { return nil } - return "ss://\(decoded)" + let s = decoded.trimmingCharacters(in: CharacterSet(charactersIn: "\n")) + return "ss://\(s)" } guard let decodedUrl = decodeUrl(url: url) else {