Skip to content

Commit

Permalink
chore: use common.SubstringBetween
Browse files Browse the repository at this point in the history
Signed-off-by: HystericalDragon <HystericalDragons@proton.me>
  • Loading branch information
xchacha20-poly1305 committed Jun 22, 2024
1 parent e15bb6c commit eaa2fe5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 55 deletions.
21 changes: 0 additions & 21 deletions libcore/strings.go

This file was deleted.

33 changes: 0 additions & 33 deletions libcore/strings_test.go

This file was deleted.

3 changes: 2 additions & 1 deletion libcore/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"strings"
_ "unsafe"

"github.com/sagernet/sing/common"
E "github.com/sagernet/sing/common/exceptions"
)

Expand Down Expand Up @@ -73,7 +74,7 @@ func ParseURL(rawURL string) (URL, error) {
if !strings.Contains(errStr, "invalid port") {
return nil, E.Cause(err, "pause rawURL")
}
multiplePort := stringBetween(errStr, "invalid port \"", "\" after host")
multiplePort := common.SubstringBetween(errStr, "invalid port \"", "\" after host")
noPort := strings.Replace(rawURL, multiplePort, "", 1)
uu, err = url.Parse(noPort)
if err != nil {
Expand Down

0 comments on commit eaa2fe5

Please sign in to comment.