1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-14 22:47:21 +00:00

add bool for performance

This commit is contained in:
silverwind
2024-04-03 01:52:56 +02:00
parent bd4559c4cd
commit d5c7b6d502
4 changed files with 6 additions and 3 deletions

View File

@ -38,6 +38,7 @@ var (
CSRFCookieName = "_csrf"
CSRFCookieHTTPOnly = true
XFrameOptions string
UseXFrameOptions bool
)
// loadSecret load the secret from ini by uriKey or verbatimKey, only one of them could be set
@ -140,7 +141,9 @@ func loadSecurityFrom(rootCfg ConfigProvider) {
CSRFCookieHTTPOnly = sec.Key("CSRF_COOKIE_HTTP_ONLY").MustBool(true)
PasswordCheckPwn = sec.Key("PASSWORD_CHECK_PWN").MustBool(false)
SuccessfulTokensCacheSize = sec.Key("SUCCESSFUL_TOKENS_CACHE_SIZE").MustInt(20)
XFrameOptions = sec.Key("X_FRAME_OPTIONS").MustString("SAMEORIGIN")
UseXFrameOptions = XFrameOptions != "false"
InternalToken = loadSecret(sec, "INTERNAL_TOKEN_URI", "INTERNAL_TOKEN")
if InstallLock && InternalToken == "" {