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:
parent
6802f5e0b6
commit
6e161a1d2e
@ -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)
|
||||
|
||||
@ -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")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user