Skip to content

Commit f4bfaa2

Browse files
committed
Merge remote-tracking branch 'origin/main' into feature/issue_metrics
2 parents 7616dd7 + 620c569 commit f4bfaa2

File tree

9 files changed

+18
-6
lines changed

9 files changed

+18
-6
lines changed

custom/conf/app.example.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,9 @@ PATH =
993993
;;
994994
;; allow request with credentials
995995
;ALLOW_CREDENTIALS = false
996+
;;
997+
;; set X-FRAME-OPTIONS header
998+
;X_FRAME_OPTIONS = SAMEORIGIN
996999

9971000
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
9981001
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

docs/content/doc/advanced/config-cheat-sheet.en-us.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
162162
- `METHODS`: **GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS**: list of methods allowed to request
163163
- `MAX_AGE`: **10m**: max time to cache response
164164
- `ALLOW_CREDENTIALS`: **false**: allow request with credentials
165+
- `X_FRAME_OPTIONS`: **SAMEORIGIN**: Set the `X-Frame-Options` header value.
165166

166167
## UI (`ui`)
167168

docs/content/doc/features/authentication.en-us.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ To configure PAM, set the 'PAM Service Name' to a filename in `/etc/pam.d/`. To
170170
work with normal Linux passwords, the user running Gitea must have read access
171171
to `/etc/shadow`.
172172

173+
**Note**: PAM support is added via [build-time flags](https://docs.gitea.io/en-us/install-from-source/#build), and the official binaries provided do not have this enabled.
174+
173175
## SMTP (Simple Mail Transfer Protocol)
174176

175177
This option allows Gitea to log in to an SMTP host as a Gitea user. To

modules/context/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ func APIContexter() func(http.Handler) http.Handler {
270270
}
271271
}
272272

273-
ctx.Resp.Header().Set(`X-Frame-Options`, `SAMEORIGIN`)
273+
ctx.Resp.Header().Set(`X-Frame-Options`, setting.CORSConfig.XFrameOptions)
274274

275275
ctx.Data["CsrfToken"] = html.EscapeString(ctx.csrf.GetToken())
276276

modules/context/context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ func Contexter() func(next http.Handler) http.Handler {
729729
}
730730
}
731731

732-
ctx.Resp.Header().Set(`X-Frame-Options`, `SAMEORIGIN`)
732+
ctx.Resp.Header().Set(`X-Frame-Options`, setting.CORSConfig.XFrameOptions)
733733

734734
ctx.Data["CsrfToken"] = html.EscapeString(ctx.csrf.GetToken())
735735
ctx.Data["CsrfTokenHtml"] = template.HTML(`<input type="hidden" name="_csrf" value="` + ctx.Data["CsrfToken"].(string) + `">`)

modules/setting/cors.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ var (
2020
Methods []string
2121
MaxAge time.Duration
2222
AllowCredentials bool
23+
XFrameOptions string
2324
}{
24-
Enabled: false,
25-
MaxAge: 10 * time.Minute,
25+
Enabled: false,
26+
MaxAge: 10 * time.Minute,
27+
XFrameOptions: "SAMEORIGIN",
2628
}
2729
)
2830

options/locale/locale_ja-JP.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,6 +1437,10 @@ pulls.no_merge_helper=リポジトリ設定でマージを有効にするか、
14371437
pulls.no_merge_wip=このプルリクエストはWork In Progressとマークされているため、マージすることはできません。
14381438
pulls.no_merge_not_ready=このプルリクエストはマージする準備ができていません。 レビュー状況とステータスチェックを確認してください。
14391439
pulls.no_merge_access=このプルリクエストをマージする権限がありません。
1440+
pulls.merge_pull_request=マージコミットを作成
1441+
pulls.rebase_merge_pull_request=リベース後にファストフォワード
1442+
pulls.rebase_merge_commit_pull_request=リベース後にマージコミット作成
1443+
pulls.squash_merge_pull_request=スカッシュコミットを作成
14401444
pulls.merge_manually=手動マージ済みにする
14411445
pulls.merge_commit_id=マージコミットID
14421446
pulls.require_signed_wont_sign=ブランチでは署名されたコミットが必須ですが、このマージでは署名がされません

routers/install/routes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func installRecovery() func(next http.Handler) http.Handler {
6161
"SignedUserName": "",
6262
}
6363

64-
w.Header().Set(`X-Frame-Options`, `SAMEORIGIN`)
64+
w.Header().Set(`X-Frame-Options`, setting.CORSConfig.XFrameOptions)
6565

6666
if !setting.IsProd() {
6767
store["ErrorMsg"] = combinedErr

routers/web/base.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ func Recovery() func(next http.Handler) http.Handler {
171171
store["SignedUserName"] = ""
172172
}
173173

174-
w.Header().Set(`X-Frame-Options`, `SAMEORIGIN`)
174+
w.Header().Set(`X-Frame-Options`, setting.CORSConfig.XFrameOptions)
175175

176176
if !setting.IsProd() {
177177
store["ErrorMsg"] = combinedErr

0 commit comments

Comments
 (0)