Skip to content

Commit

Permalink
Strip port from gogs netrc file
Browse files Browse the repository at this point in the history
  • Loading branch information
bradrydzewski committed Dec 24, 2015
1 parent 247aadf commit 32cdf41
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions remote/gogs/gogs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package gogs

import (
"fmt"
"net"
"net/http"
"net/url"
"strconv"
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 32cdf41

Please sign in to comment.