Skip to content

Commit

Permalink
Merge pull request #2477 from snelis/master
Browse files Browse the repository at this point in the history
Change TrimLeft for TrimPrefix on the from-to-www redirect
  • Loading branch information
k8s-ci-robot authored May 8, 2018
2 parents e6cb9fb + cfc7cbc commit a30b96b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/ingress/controller/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ func (n *NGINXController) OnUpdate(ingressCfg ingress.Configuration) error {
if srv.RedirectFromToWWW {
var n string
if strings.HasPrefix(srv.Hostname, "www.") {
n = strings.TrimLeft(srv.Hostname, "www.")
n = strings.TrimPrefix(srv.Hostname, "www.")
} else {
n = fmt.Sprintf("www.%v", srv.Hostname)
}
Expand Down

0 comments on commit a30b96b

Please sign in to comment.