aboutsummaryrefslogtreecommitdiff
path: root/handler.go
diff options
context:
space:
mode:
Diffstat (limited to 'handler.go')
-rw-r--r--handler.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/handler.go b/handler.go
index b10b8f5..0490a83 100644
--- a/handler.go
+++ b/handler.go
@@ -53,7 +53,11 @@ type packageHandler struct {
}
func (h packageHandler) Handle(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
- canonicalURL := fmt.Sprintf("%s/%s", h.config.URL, h.pkgName)
+ baseURL := h.config.URL
+ if h.pkg.URL != "" {
+ baseURL = h.pkg.URL
+ }
+ canonicalURL := fmt.Sprintf("%s/%s", baseURL, h.pkgName)
data := struct {
Repo string
Branch string