mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-09-08 20:46:25 +08:00
refactor: simplify code with Go 1.25 APIs
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user