Merge pull request #663 from aledbf/remove-todo
Remove helper required in go < 1.8
This commit is contained in:
commit
a1b6fa7d5b
1 changed files with 1 additions and 13 deletions
|
@ -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]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue