diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-04-27 14:06:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-27 02:06:45 -0400 |
commit | 92fd3fc4fd369b6a8c0a022a32a80dec2340223a (patch) | |
tree | c721a4988b5ec250a029b19274ef1c2dc4c19faa /routers/web/base.go | |
parent | 1c875ef5bef206b8214c33437f65af929967df46 (diff) | |
download | gitea-92fd3fc4fd369b6a8c0a022a32a80dec2340223a.tar.gz gitea-92fd3fc4fd369b6a8c0a022a32a80dec2340223a.zip |
Refactor "route" related code, fix Safari cookie bug (#24330)
Fix #24176
Clean some misuses of route package, clean some legacy FIXMEs
---------
Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'routers/web/base.go')
-rw-r--r-- | routers/web/base.go | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/routers/web/base.go b/routers/web/base.go index 79991d89db..b5d7a737bf 100644 --- a/routers/web/base.go +++ b/routers/web/base.go @@ -59,12 +59,7 @@ func storageHandler(storageSetting setting.Storage, prefix string, objStore stor return } - http.Redirect( - w, - req, - u.String(), - http.StatusTemporaryRedirect, - ) + http.Redirect(w, req, u.String(), http.StatusTemporaryRedirect) }) } @@ -122,9 +117,9 @@ func (d *dataStore) GetData() map[string]interface{} { return *d } -// Recovery returns a middleware that recovers from any panics and writes a 500 and a log if so. +// RecoveryWith500Page returns a middleware that recovers from any panics and writes a 500 and a log if so. // This error will be created with the gitea 500 page. -func Recovery(ctx goctx.Context) func(next http.Handler) http.Handler { +func RecoveryWith500Page(ctx goctx.Context) func(next http.Handler) http.Handler { _, rnd := templates.HTMLRenderer(ctx) return func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { |