Browse Source

http: fix non-sense `NotFound` call (#7003)

Joe Chen 2 năm trước cách đây
mục cha
commit
8e8b185ea1
2 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 1 0
      CHANGELOG.md
  2. 1 1
      internal/route/repo/http.go

+ 1 - 0
CHANGELOG.md

@@ -27,6 +27,7 @@ All notable changes to Gogs are documented in this file.
 - _Security:_ Remote Command Execution in file editing. [#6555](https://github.com/gogs/gogs/issues/6555)
 - 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
 

+ 1 - 1
internal/route/repo/http.go

@@ -99,7 +99,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
 		}