From bdce82be38dd5361f0d7b8054f3908ce73c7e1ea Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Wed, 8 Apr 2026 22:12:09 +0200 Subject: [PATCH] fix: handle "_" as default repo in HTTP handlers The webui uses "_" as the URL slug for the default repository. Add it alongside "" in the gitfile and upload handler switch cases so they resolve to DefaultRepo() correctly. Co-Authored-By: Claude Opus 4.6 (1M context) --- api/http/git_file_handler.go | 2 +- api/http/git_file_upload_handler.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/http/git_file_handler.go b/api/http/git_file_handler.go index 60c175c95cfd94cd6172b3000d4a069e1b3fd69e..eb26b5d121d608c00e99d8065bce8722769de620 100644 --- a/api/http/git_file_handler.go +++ b/api/http/git_file_handler.go @@ -40,7 +40,7 @@ func (gfh *gitFileHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request) { var err error switch repoVar := vars["repo"]; repoVar { - case "": + case "", "_": repo, err = gfh.mrc.DefaultRepo() default: repo, err = gfh.mrc.ResolveRepo(repoVar) diff --git a/api/http/git_file_upload_handler.go b/api/http/git_file_upload_handler.go index 9aa95def87dbff88786be1ee00a405f71f79bcf9..3f239fa5d6224f88167ef6a9145cd19e9ba84926 100644 --- a/api/http/git_file_upload_handler.go +++ b/api/http/git_file_upload_handler.go @@ -30,7 +30,7 @@ func (gufh *gitUploadFileHandler) ServeHTTP(rw http.ResponseWriter, r *http.Requ repoVar := mux.Vars(r)["repo"] switch repoVar { - case "": + case "", "_": repo, err = gufh.mrc.DefaultRepo() default: repo, err = gufh.mrc.ResolveRepo(repoVar)