Change custom headers separator
This commit is contained in:
parent
d6ad7e2e64
commit
3a99c86cb3
7 changed files with 39 additions and 28 deletions
|
@ -1,6 +1,7 @@
|
|||
package kubernetes
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/containous/traefik/log"
|
||||
|
@ -50,12 +51,12 @@ func getMapAnnotation(meta *v1beta1.Ingress, annotName string) map[string]string
|
|||
}
|
||||
|
||||
mapValue := make(map[string]string)
|
||||
for _, parts := range strings.Split(values, ",") {
|
||||
pair := strings.Split(parts, ":")
|
||||
for _, parts := range strings.Split(values, "||") {
|
||||
pair := strings.SplitN(parts, ":", 2)
|
||||
if len(pair) != 2 {
|
||||
log.Warnf("Could not load %q: %v, skipping...", annotName, pair)
|
||||
} else {
|
||||
mapValue[pair[0]] = pair[1]
|
||||
mapValue[http.CanonicalHeaderKey(strings.TrimSpace(pair[0]))] = strings.TrimSpace(pair[1])
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue