Skip to content

Commit 16f5c71

Browse files
matheusmoscaunknwon
authored andcommitted
context: add X-Frame-Options header (#6411)
Co-authored-by: ᴜɴᴋɴᴡᴏɴ <[email protected]>
1 parent 91c09d1 commit 16f5c71

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

CHANGELOG.md

+2-7
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ All notable changes to Gogs are documented in this file.
77
### Added
88

99
- An unlisted option is added when create or migrate a repository. Unlisted repositories are public but not being listed for users without direct access in the UI. [#5733](https://github.com/gogs/gogs/issues/5733)
10+
- Add new configuration option `[git.timeout] DIFF` for customizing operation timeout of `git diff`. [#6315](https://github.com/gogs/gogs/issues/6315)
1011

1112
### Changed
1213

@@ -16,13 +17,7 @@ All notable changes to Gogs are documented in this file.
1617

1718
### Fixed
1819

19-
- _Regression:_ Pages are correctly rendered when requesting `?go-get=1` for subdirectories. [#6314](https://github.com/gogs/gogs/issues/6314)
20-
- _Regression:_ Submodule with a relative path is linked correctly. [#6319](https://github.com/gogs/gogs/issues/6319)
21-
- Backup can be processed when `--target` is specified on Windows. [#6339](https://github.com/gogs/gogs/issues/6339)
22-
- Commit message contains keywords look like an issue reference no longer fails the push entirely. [#6289](https://github.com/gogs/gogs/issues/6289)
23-
- _Regression:_ When running Gogs on Windows, push commits no longer fail on a daily basis with the error "pre-receive hook declined". [#6316](https://github.com/gogs/gogs/issues/6316)
24-
- Auto-linked commit SHAs now have correct links. [#6300](https://github.com/gogs/gogs/issues/6300)
25-
- Git LFS client (with version >= 2.5.0) wasn't able to upload files with known format (e.g. PNG, JPEG), and the server is expecting the HTTP Header `Content-Type` to be `application/octet-stream`. The server now tells the LFS client to always use `Content-Type: application/octet-stream` when upload files.
20+
- Add `X-Frame-Options` header to prevent Clickjacking. [#6409](https://github.com/gogs/gogs/issues/6409)
2621

2722
### Removed
2823

internal/context/context.go

+1
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ func Contexter() macaron.Handler {
291291
// 🚨 SECURITY: Prevent MIME type sniffing in some browsers,
292292
// see https://github.com/gogs/gogs/issues/5397 for details.
293293
c.Header().Set("X-Content-Type-Options", "nosniff")
294+
c.Header().Set("X-Frame-Options", "DENY")
294295

295296
ctx.Map(c)
296297
}

0 commit comments

Comments
 (0)