mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Middleware: Add Custom Headers to HTTP responses (#59018)
* Middleware: Add Custom Headers to HTTP responses * Update docs/sources/setup-grafana/configure-grafana/_index.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update conf/defaults.ini Co-authored-by: Dave Henderson <dave.henderson@grafana.com> * Update conf/sample.ini Co-authored-by: Dave Henderson <dave.henderson@grafana.com> * Update _index.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
This commit is contained in:
@@ -598,6 +598,10 @@ func (hs *HTTPServer) addMiddlewaresAndStaticRoutes() {
|
||||
hs.mapStatic(m, hs.Cfg.ImagesDir, "", "/public/img/attachments")
|
||||
}
|
||||
|
||||
if len(hs.Cfg.CustomResponseHeaders) > 0 {
|
||||
m.Use(middleware.AddCustomResponseHeaders(hs.Cfg))
|
||||
}
|
||||
|
||||
m.Use(middleware.AddDefaultResponseHeaders(hs.Cfg))
|
||||
|
||||
if hs.Cfg.ServeFromSubPath && hs.Cfg.AppSubURL != "" {
|
||||
|
||||
Reference in New Issue
Block a user