mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-10-25 19:42:38 +00:00
[BRANDING] add X-Forgejo-* headers
(cherry picked from commit0a3388f93f) (cherry picked from commit7eba0a440a) (cherry picked from commiteb9646c7ef) (cherry picked from commitf1972578f5) Conflicts: (cherry picked from commit7f96222fb4) (cherry picked from commite3c7c9fe7b) (cherry picked from commit84fdead902) (cherry picked from commit85148e1196) (cherry picked from commitc0086bd70d) (cherry picked from commitd1e31ef318) (cherry picked from commit681d3ed5c4) (cherry picked from commit76a3001f5b) (cherry picked from commita55a9567d3)
This commit is contained in:
parent
4eca363082
commit
aa7adc167d
6 changed files with 25 additions and 2 deletions
|
|
@ -30,6 +30,7 @@ func SetCacheControlInHeader(h http.Header, maxAge time.Duration, additionalDire
|
|||
|
||||
// to remind users they are using non-prod setting.
|
||||
h.Set("X-Gitea-Debug", "RUN_MODE="+setting.RunMode)
|
||||
h.Set("X-Forgejo-Debug", "RUN_MODE="+setting.RunMode)
|
||||
}
|
||||
|
||||
h.Set("Cache-Control", strings.Join(append(directives, additionalDirectives...), ", "))
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@ func countFormalHeaders(h http.Header) (c int) {
|
|||
if strings.HasPrefix(k, "X-Gitea-") {
|
||||
continue
|
||||
}
|
||||
if strings.HasPrefix(k, "X-Forgejo-") {
|
||||
continue
|
||||
}
|
||||
c++
|
||||
}
|
||||
return c
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue