diff options
author | Runxi Yu <me@runxiyu.org> | 2025-02-16 02:31:16 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-02-16 02:31:16 +0800 |
commit | e274e949e6f8fc442e8c464ff1a294edd61ba8e0 (patch) | |
tree | aa139ee5373153c67072271f194f6ad68690d389 /http_server.go | |
parent | repo_index: Add HTTP clone along with SSH (diff) | |
download | forge-e274e949e6f8fc442e8c464ff1a294edd61ba8e0.tar.gz forge-e274e949e6f8fc442e8c464ff1a294edd61ba8e0.tar.zst forge-e274e949e6f8fc442e8c464ff1a294edd61ba8e0.zip |
*.go: Fix missing error handling
Diffstat (limited to 'http_server.go')
-rw-r--r-- | http_server.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/http_server.go b/http_server.go index 1a4d0a3..948117d 100644 --- a/http_server.go +++ b/http_server.go @@ -131,9 +131,15 @@ func (router *http_router_t) ServeHTTP(w http.ResponseWriter, r *http.Request) { repo_feature := segments[separator_index+3] switch repo_feature { case "info": - handle_repo_info(w, r, params) + err = handle_repo_info(w, r, params) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + } case "git-upload-pack": - handle_upload_pack(w, r, params) + err = handle_upload_pack(w, r, params) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + } case "tree": params["rest"] = strings.Join(segments[separator_index+4:], "/") if len(segments) < separator_index+5 && redirect_with_slash(w, r) { |