aboutsummaryrefslogtreecommitdiff
path: root/handler.go
diff options
context:
space:
mode:
authorGravatar Jan-Philipp Benecke <github@bnck.me> 2021-05-19 00:49:33 +0200
committerGravatar GitHub <noreply@github.com> 2021-05-18 15:49:33 -0700
commit4f8f13fd76f065e49efdb3aa1a7504ffcafbf9a8 (patch)
treef68612e4882f707840ef0a1bc0d14477dfcb1c06 /handler.go
parentb627e361379b89802df4930abbc64ce26bd8f323 (diff)
downloadsally-4f8f13fd76f065e49efdb3aa1a7504ffcafbf9a8.tar.gz
sally-4f8f13fd76f065e49efdb3aa1a7504ffcafbf9a8.tar.zst
sally-4f8f13fd76f065e49efdb3aa1a7504ffcafbf9a8.zip
Allow setting branch (#46)
Support specifying the branch from which source will be served in the YAML configuration.
Diffstat (limited to 'handler.go')
-rw-r--r--handler.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/handler.go b/handler.go
index 2f32132..a29f399 100644
--- a/handler.go
+++ b/handler.go
@@ -55,10 +55,12 @@ func (h packageHandler) Handle(w http.ResponseWriter, r *http.Request, ps httpro
canonicalURL := fmt.Sprintf("%s/%s", h.config.URL, h.pkgName)
data := struct {
Repo string
+ Branch string
CanonicalURL string
GodocURL string
}{
Repo: h.pkg.Repo,
+ Branch: h.pkg.Branch,
CanonicalURL: canonicalURL,
GodocURL: fmt.Sprintf("https://%s/%s%s", h.config.Godoc.Host, canonicalURL, ps.ByName("path")),
}