loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Git client will follow 301 but 307 (#34005)

Fix #28460

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 356b707dde00f61f806c8a27879830a1d9b5b895)

authored by

Lunny Xiao
wxiaoguang
and committed by
Gusted
50f8563c f68d49cb

+3 -1
+3 -1
services/context/repo.go
··· 361 361 if ctx.Req.URL.RawQuery != "" { 362 362 redirectPath += "?" + ctx.Req.URL.RawQuery 363 363 } 364 - ctx.Redirect(path.Join(setting.AppSubURL, redirectPath), http.StatusTemporaryRedirect) 364 + // Git client needs a 301 redirect by default to follow the new location 365 + // It's not documentated in git documentation, but it's the behavior of git client 366 + ctx.Redirect(path.Join(setting.AppSubURL, redirectPath), http.StatusMovedPermanently) 365 367 } 366 368 367 369 func repoAssignment(ctx *Context, repo *repo_model.Repository) {