+2
-1
knotserver/routes.go
+2
-1
knotserver/routes.go
···
183
func (h *Handle) Blob(w http.ResponseWriter, r *http.Request) {
184
treePath := chi.URLParam(r, "*")
185
ref := chi.URLParam(r, "ref")
186
187
l := h.l.With("handler", "FileContent", "ref", ref, "treePath", treePath)
188
···
333
334
func (h *Handle) Diff(w http.ResponseWriter, r *http.Request) {
335
ref := chi.URLParam(r, "ref")
336
337
l := h.l.With("handler", "Diff", "ref", ref)
338
···
491
return
492
}
493
494
-
log.Println("branch", data.DefaultBranch)
495
if data.DefaultBranch == "" {
496
data.DefaultBranch = h.c.Repo.MainBranch
497
}
···
183
func (h *Handle) Blob(w http.ResponseWriter, r *http.Request) {
184
treePath := chi.URLParam(r, "*")
185
ref := chi.URLParam(r, "ref")
186
+
ref, _ = url.PathUnescape(ref)
187
188
l := h.l.With("handler", "FileContent", "ref", ref, "treePath", treePath)
189
···
334
335
func (h *Handle) Diff(w http.ResponseWriter, r *http.Request) {
336
ref := chi.URLParam(r, "ref")
337
+
ref, _ = url.PathUnescape(ref)
338
339
l := h.l.With("handler", "Diff", "ref", ref)
340
···
493
return
494
}
495
496
if data.DefaultBranch == "" {
497
data.DefaultBranch = h.c.Repo.MainBranch
498
}