Skip to content

Commit

Permalink
Collapse encoding.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbruens committed Jul 15, 2024
1 parent 435f8a3 commit eb3f837
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions x/config/shadowsocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ func parseShadowsocksSIP002URL(url *url.URL) (*shadowsocksConfig, error) {
config.serverAddress = url.Host
userInfo := url.User.String()
// Cipher info can be optionally encoded with Base64URL.
encoding := base64.URLEncoding.WithPadding(base64.NoPadding)
decodedUserInfo, err := encoding.DecodeString(userInfo)
decodedUserInfo, err := base64.URLEncoding.WithPadding(base64.NoPadding).DecodeString(userInfo)
var cipherInfo string
if err == nil {
cipherInfo = string(decodedUserInfo)
Expand Down

0 comments on commit eb3f837

Please sign in to comment.