mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-31 14:13:09 +02:00
restructured the project to comply community guideline, for others check release note
This commit is contained in:
19
internal/proxy/fields/headers.go
Normal file
19
internal/proxy/fields/headers.go
Normal file
@@ -0,0 +1,19 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user