mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-27 04:11:03 +00:00
Strip port from gogs netrc file
This commit is contained in:
parent
247aadf84b
commit
32cdf41ce7
1 changed files with 5 additions and 0 deletions
|
@ -2,6 +2,7 @@ package gogs
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
|
@ -179,6 +180,10 @@ func (g *Gogs) Netrc(u *model.User, r *model.Repo) (*model.Netrc, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
host, _, err := net.SplitHostPort(url_.Host)
|
||||
if err == nil {
|
||||
url_.Host=host
|
||||
}
|
||||
return &model.Netrc{
|
||||
Login: u.Token,
|
||||
Password: "x-oauth-basic",
|
||||
|
|
Loading…
Reference in a new issue