refactor: replace custom helper with stdlib strings.*

This commit is contained in:
yusing
2026-02-18 14:26:29 +08:00
parent c2d8cca3b4
commit bb757b2432
9 changed files with 15 additions and 16 deletions

View File

@@ -8,7 +8,6 @@ import (
"time"
"github.com/yusing/godoxy/internal/common"
strutils "github.com/yusing/goutils/strings"
)
var (
@@ -70,12 +69,12 @@ func cookieDomain(r *http.Request) string {
}
}
parts := strutils.SplitRune(reqHost, '.')
parts := strings.Split(reqHost, ".")
if len(parts) < 2 {
return ""
}
parts[0] = ""
return strutils.JoinRune(parts, '.')
return strings.Join(parts, ".")
}
func SetTokenCookie(w http.ResponseWriter, r *http.Request, name, value string, ttl time.Duration) {