From 75e10445ca8ecd76f3950825ffd161c2fc32da6a Mon Sep 17 00:00:00 2001 From: Joe Chen Date: Sat, 4 Jun 2022 10:44:54 +0800 Subject: [PATCH] http: fix non-sense `NotFound` call (#7003) --- CHANGELOG.md | 1 + internal/route/repo/http.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ccddc06a..f3ecfc6c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ All notable changes to Gogs are documented in this file. - Unable to use LDAP authentication on ARM machines. [#6761](https://github.com/gogs/gogs/issues/6761) - Unable to init repository during creation on Windows. [#6967](https://github.com/gogs/gogs/issues/6967) +- Mysterious panic on `Value not found for type *repo.HTTPContext`. [#6963](https://github.com/gogs/gogs/issues/6963) ### Removed diff --git a/internal/route/repo/http.go b/internal/route/repo/http.go index 67d8edf86..e5a7570dd 100644 --- a/internal/route/repo/http.go +++ b/internal/route/repo/http.go @@ -100,7 +100,7 @@ func HTTPContexter() macaron.Handler { !strings.Contains(action, "info/") && !strings.Contains(action, "HEAD") && !strings.Contains(action, "objects/") { - c.NotFound() + c.Error(http.StatusBadRequest, fmt.Sprintf("Unrecognized action %q", action)) return }