1
0
Fork 0
forked from forgejo/forgejo

[BRANDING] add X-Forgejo-* headers

This commit is contained in:
Earl Warren 2023-01-14 08:16:30 +01:00 committed by Loïc Dachary
parent 6cd61e2ab7
commit 0a3388f93f
No known key found for this signature in database
GPG key ID: 992D23B392F9E4F2
6 changed files with 25 additions and 2 deletions

View file

@ -675,7 +675,7 @@ func Routes(ctx gocontext.Context) *web.Route {
// setting.CORSConfig.AllowSubdomain // FIXME: the cors middleware needs allowSubdomain option
AllowedMethods: setting.CORSConfig.Methods,
AllowCredentials: setting.CORSConfig.AllowCredentials,
AllowedHeaders: append([]string{"Authorization", "X-Gitea-OTP"}, setting.CORSConfig.Headers...),
AllowedHeaders: append([]string{"Authorization", "X-Gitea-OTP", "X-Forgejo-OTP"}, setting.CORSConfig.Headers...),
MaxAge: int(setting.CORSConfig.MaxAge.Seconds()),
}))
}