func SetCookieSanitizer(unsafe string) string {
	directives := strings.SplitN(unsafe, ";", 2)
	cookie := strings.SplitN(directives[0], "=", 2)
	l := 0
	if len(cookie) > 1 {
		l = len(cookie[1])
	}
	if len(directives) == 2 {
		return fmt.Sprintf("%s=%s; %s", cookie[0], redact(l), strings.TrimPrefix(directives[1], " "))
	}
	return fmt.Sprintf("%s=%s", cookie[0], redact(l))
}
SetCookieSanitizer is used to sanitize Set-Cookie header.
package header
import (
	"fmt"
	"net/http"
	"strings"
)
func Sanitize(sanitizers map[string]SanitizeHeaderFunc, headers http.Header) http.Header {
	var redacted = http.Header{}
	for k, values := range headers {
		if s, ok := sanitizers[http.CanonicalHeaderKey(k)]; ok {
			redacted[k] = sanitize(s, values)
			continue
		}
		redacted[k] = values
	}
	return redacted
}
func sanitize(s SanitizeHeaderFunc, values []string) []string {
	var redacted = []string{}
	for _, v := range values {
		redacted = append(redacted, s(v))
	}
	return redacted
}
var DefaultSanitizers = map[string]SanitizeHeaderFunc{
	"Authorization":       AuthorizationSanitizer,
	"Set-Cookie":          SetCookieSanitizer,
	"Cookie":              CookieSanitizer,
	"Proxy-Authorization": AuthorizationSanitizer,
}
type SanitizeHeaderFunc func(string) string
func AuthorizationSanitizer(unsafe string) string {
	if unsafe == "" {
		return ""
	}
	directives := strings.SplitN(unsafe, " ", 2)
	l := 0
	if len(directives) > 1 {
		l = len(directives[1])
	}
	if l == 0 {
		return directives[0]
	}
	return directives[0] + " " + redact(l)
}