Skip to content

Commit 84741ca

Browse files
committed
Prefix github requests with repos
1 parent 9e3809a commit 84741ca

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

api/github.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import (
77
"net/url"
88
"regexp"
99
"strings"
10-
11-
"github.com/sirupsen/logrus"
1210
)
1311

1412
// GitHubGateway acts as a proxy to GitHub
@@ -49,7 +47,9 @@ func director(r *http.Request) {
4947
if r.Method != http.MethodOptions {
5048
r.Header.Set("Authorization", "Bearer "+accessToken)
5149
}
52-
logrus.Infof("Proxying to: %v", r.URL.String())
50+
51+
log := getLogEntry(r)
52+
log.Infof("Proxying to GitHub: %v", r.URL.String())
5353
}
5454

5555
func (gh *GitHubGateway) ServeHTTP(w http.ResponseWriter, r *http.Request) {
@@ -73,9 +73,9 @@ func (gh *GitHubGateway) ServeHTTP(w http.ResponseWriter, r *http.Request) {
7373
}
7474
var apiURL string
7575
if strings.HasSuffix(endpoint, "/") {
76-
apiURL = endpoint + config.GitHub.Repo
76+
apiURL = endpoint + "repos/" + config.GitHub.Repo
7777
} else {
78-
apiURL = endpoint + "/" + config.GitHub.Repo
78+
apiURL = endpoint + "/repos/" + config.GitHub.Repo
7979
}
8080

8181
target, err := url.Parse(apiURL)

0 commit comments

Comments
 (0)