mirror of
https://github.com/yusing/godoxy.git
synced 2026-01-18 09:27:17 +01:00
20 lines
366 B
Go
20 lines
366 B
Go
package fields
|
|
|
|
import (
|
|
"net/http"
|
|
"strings"
|
|
|
|
E "github.com/yusing/go-proxy/internal/error"
|
|
)
|
|
|
|
func ValidateHTTPHeaders(headers map[string]string) (http.Header, E.NestedError) {
|
|
h := make(http.Header)
|
|
for k, v := range headers {
|
|
vSplit := strings.Split(v, ",")
|
|
for _, header := range vSplit {
|
|
h.Add(k, strings.TrimSpace(header))
|
|
}
|
|
}
|
|
return h, nil
|
|
}
|