Move X_FRAME_OPTIONS setting from cors to security section#30256
Move X_FRAME_OPTIONS setting from cors to security section#30256silverwind merged 20 commits intogo-gitea:mainfrom
X_FRAME_OPTIONS setting from cors to security section#30256Conversation
cors.X_FRAME_OPTIONS to security.X_FRAME_OPTIONS and add falseoptioncors.X_FRAME_OPTIONS to security.X_FRAME_OPTIONS and add false option
|
BTW, the reason I investigated this is to set a default CSP header. CSP does include a |
|
I guess it's alright to merge this as-is. If we introduce CSP later, we can change the default of this value to |
|
Maybe we should have a warning if we detect the old value and have some warning on the admin panel. |
Should be possible. Any pointers where this warning code is? |
|
You can use |
* origin/main: (2555 commits) automate updating nix flakes (go-gitea#35641) Update AGENTS.md instructions (go-gitea#36627) use user id in noreply emails (go-gitea#36550) feat(db): Improve BuildCaseInsensitiveLike with lowercase (go-gitea#36598) [skip ci] Updated translations via Crowdin BUG: Fix workflow run jobs API returning null steps (go-gitea#36603) Refactor highlight and diff (go-gitea#36599) Fix bug when do LFS GC (go-gitea#36500) feature to be able to filter project boards by milestones (go-gitea#36321) Update emoji data for Unicode 16 (go-gitea#36596) Adapt monaco error matching pattern to recent webpack config change (go-gitea#36533) Fix a bug user could change another user's primary email (go-gitea#36586) fix(repo-editor): disable Monaco `editContext` to avoid bugs with lost focus (go-gitea#36585) Fine tune diff highlighting (go-gitea#36592) Add code editor setting dropdowns (go-gitea#36534) Update to go 1.26.0 and golangci-lint 2.9.0 (go-gitea#36588) Improve diff highlighting (go-gitea#36583) Fix markup code block layout (go-gitea#36578) Remove striped tables in UI (go-gitea#36509) Fix vertical alignment of `.commit-sign-badge` children (go-gitea#36570) ... # Conflicts: # custom/conf/app.example.ini # docs/content/administration/config-cheat-sheet.en-us.md # docs/content/administration/config-cheat-sheet.zh-cn.md # modules/setting/security.go # routers/common/errpage.go # services/context/api.go # services/context/context.go
…ation warning Use `deprecatedSetting` to warn when the old `[cors].X_FRAME_OPTIONS` config option is still present, with fallback to read from the old location. Update deprecation target to v1.26.0. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Clear `StartupProblems` at the start of `LoadCommonSettings` to prevent duplicate warnings. The function is called twice during web server startup (early init in cmd/main.go and again in cmd/web.go), causing every deprecatedSetting warning to appear twice in the admin panel. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This reverts commit c978d05.
|
Updated and addressed all comments. There is a pre-existing bug that results in all startup warnings to be shown twice in the UI, I opened #36630 for it. |
|
Updated PR title and description. This is no longer breaking, the old location is being deprecated but still works. |
|
Changes:
|
X_FRAME_OPTIONS setting from cors to security sectionX_FRAME_OPTIONS to security section and unify attachment size limits
X_FRAME_OPTIONS to security section and unify attachment size limitsX_FRAME_OPTIONS setting from cors to security section
|
PR description updated |
|
changes are lgtm |
* giteaofficial/main: (81 commits) Add keyboard shortcuts for repository file and code search (go-gitea#36416) Refactor text utility classes to Tailwind CSS (go-gitea#36703) Prevent redirect bypasses via backslash-encoded paths (go-gitea#36660) Fix force push time-line commit comments of pull request (go-gitea#36653) Fix get release draft permission check (go-gitea#36659) Move `X_FRAME_OPTIONS` setting from `cors` to `security` section (go-gitea#30256) Update JS and PY deps (go-gitea#36708) Move jobparser from act repository to Gitea (go-gitea#36699) Fix push time bug (go-gitea#36693) Add icon to buttons "Close with Comment", "Close Pull Request", "Close Issue" (go-gitea#36654) various fixes (go-gitea#36697) Add AI Contribution Policy to CONTRIBUTING.md (go-gitea#36651) Add some validation on values provided to USER_DISABLED_FEATURES and EXTERNAL_USER_DISABLED_FEATURES (go-gitea#36688) Rework e2e tests (go-gitea#36634) Remove unused functions (go-gitea#36672) Add migration http transport for push/sync mirror lfs (go-gitea#36665) Fix track time issue id (go-gitea#36664) Refactor inline style attributes (go-gitea#36652) Update Nix flake (go-gitea#36679) Upgrade gogit to 5.16.5 (go-gitea#36680) ... # Conflicts: # web_src/js/features/repo-issue-content.ts
* main: (24 commits) Instance-wide (global) info banner and maintenance mode (go-gitea#36571) Add created_by filter to SearchIssues (go-gitea#36670) Inline and lazy-load EasyMDE CSS, fix border colors (go-gitea#36714) Fix release draft access check logic (go-gitea#36720) Change image transparency grid to CSS (go-gitea#36711) Avoid opening new tab when downloading actions logs (go-gitea#36740) Add validation constraints for repository creation fields (go-gitea#36671) Fix SVG height calculation in diff viewer (go-gitea#36748) Fix path resolving (go-gitea#36734) [skip ci] Updated translations via Crowdin Fix track time list permission check (go-gitea#36662) Fix incorrect setting loading order (go-gitea#36735) Use case-insensitive matching for Git error "Not a valid object name" (go-gitea#36728) feat: Add workflow dependencies visualization (go-gitea#36248) Add keyboard shortcuts for repository file and code search (go-gitea#36416) Refactor text utility classes to Tailwind CSS (go-gitea#36703) Prevent redirect bypasses via backslash-encoded paths (go-gitea#36660) Fix force push time-line commit comments of pull request (go-gitea#36653) Fix get release draft permission check (go-gitea#36659) Move `X_FRAME_OPTIONS` setting from `cors` to `security` section (go-gitea#30256) ... # Conflicts: # web_src/css/base.css # web_src/css/index.css
Summary
cors.X_FRAME_OPTIONStosecurity.X_FRAME_OPTIONS(old location still works with a deprecation warning)"unset"as a special value to remove theX-Frame-Optionsheader entirelyX-Frame-Optionsheader from API responses (only set for web/HTML responses)Migration
If you had customized
cors.X_FRAME_OPTIONS, move it to the[security]section. The old location is deprecated and will be removed in a future release.