refactor: simplify code with Go 1.25 APIs

This commit is contained in:
kevin
2026-09-05 21:44:46 +08:00
committed by Kevin Wan
parent df7801e920
commit 84c92d710b
9 changed files with 15 additions and 27 deletions
+1 -3
View File
@@ -94,9 +94,7 @@ func ParseForm(r *http.Request, v any) error {
// ParseHeader parses the request header and returns a map.
func ParseHeader(headerValue string) map[string]string {
ret := make(map[string]string)
fields := strings.Split(headerValue, separator)
for _, field := range fields {
for field := range strings.SplitSeq(headerValue, separator) {
field = strings.TrimSpace(field)
if len(field) == 0 {
continue