Skip to content

Commit

Permalink
Merge pull request #663 from aledbf/remove-todo
Browse files Browse the repository at this point in the history
Remove helper required in go < 1.8
  • Loading branch information
aledbf authored Apr 27, 2017
2 parents 192d832 + d1e77f1 commit a1b6fa7
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions core/pkg/ingress/annotations/authreq/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,22 +131,10 @@ func (a authReq) Parse(ing *extensions.Ingress) (interface{}, error) {

return &External{
URL: str,
Host: stripPort(ur.Host),
Host: ur.Hostname(),
SigninURL: signin,
Method: m,
SendBody: sb,
ResponseHeaders: h,
}, nil
}

// TODO: Remove after upgrade to Go 1.8
func stripPort(hostport string) string {
colon := strings.IndexByte(hostport, ':')
if colon == -1 {
return hostport
}
if i := strings.IndexByte(hostport, ']'); i != -1 {
return strings.TrimPrefix(hostport[:i], "[")
}
return hostport[:colon]
}

0 comments on commit a1b6fa7

Please sign in to comment.