0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-02-06 04:02:12 +01:00

fix comments

This commit is contained in:
wxiaoguang 2026-01-17 20:51:04 +08:00
parent 6802f5e0b6
commit 6e161a1d2e
2 changed files with 4 additions and 2 deletions

View File

@ -13,6 +13,8 @@ func addOwnerRepoGitHTTPRouters(m *web.Router) {
presetGitService := func(service string) func(ctx *context.Context) {
return func(ctx *context.Context) { ctx.SetPathParam("preset-git-service", service) }
}
// Some users want to use "web-based git client" to access Gitea's repositories,
// so the CORS handler and OPTIONS method are used.
m.Group("/{username}/{reponame}", func() {
m.Methods("POST,OPTIONS", "/git-upload-pack", presetGitService("git-upload-pack"), repo.ServiceUploadPack)
m.Methods("POST,OPTIONS", "/git-receive-pack", presetGitService("git-receive-pack"), repo.ServiceReceivePack)

View File

@ -189,7 +189,7 @@ func httpBase(ctx *context.Context) *serviceHandler {
}
if repoExist {
// Because of special ref "refs/for" .. , need delay write permission check
// Because of special ref "refs/for" (agit) , need delay write permission check
if git.DefaultFeatures().SupportProcReceive {
accessMode = perm.AccessModeRead
}
@ -350,7 +350,7 @@ func setHeaderNoCache(ctx *context.Context) {
func setHeaderCacheForever(ctx *context.Context) {
now := time.Now().Unix()
expires := now + 31536000
expires := now + 365*86400 // 365 days
ctx.Resp.Header().Set("Date", strconv.FormatInt(now, 10))
ctx.Resp.Header().Set("Expires", strconv.FormatInt(expires, 10))
ctx.Resp.Header().Set("Cache-Control", "public, max-age=31536000")