1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2025-09-16 08:46:30 +02:00

Strip port from gogs netrc file

This commit is contained in:
Brad Rydzewski
2015-12-24 10:09:18 -05:00
parent 247aadf84b
commit 32cdf41ce7

View File

@@ -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",