Skip to content

Commit

Permalink
Change TrimLeft for TrimPrefix on the from-to-www redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
snelis committed May 7, 2018
1 parent e6cb9fb commit cfc7cbc
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 cfc7cbc

Please sign in to comment.