refactor: go fix ftw

This commit is contained in:
2026-02-19 17:37:42 +01:00
parent 9185ffa6b5
commit 85882bae14
21 changed files with 82 additions and 98 deletions

View File

@@ -123,12 +123,12 @@ func defaultIfEmpty(value, fallback string) string {
}
func extractTokenFromBody(body string) string {
index := strings.Index(body, "token=")
if index == -1 {
_, after, ok := strings.Cut(body, "token=")
if !ok {
return ""
}
tokenPart := body[index+len("token="):]
tokenPart := after
if delimIdx := strings.IndexAny(tokenPart, "&\"'\\\r\n <>"); delimIdx != -1 {
tokenPart = tokenPart[:delimIdx]