mirror of
https://github.com/miniflux/v2.git
synced 2025-09-15 18:57:04 +00:00
Add Server-Timing header to unread page
This commit is contained in:
parent
2cf9bde1af
commit
f88e93a0b9
7 changed files with 153 additions and 2 deletions
5
ui/ui.go
5
ui/ui.go
|
@ -7,12 +7,14 @@ package ui // import "miniflux.app/ui"
|
|||
import (
|
||||
"net/http"
|
||||
|
||||
"miniflux.app/config"
|
||||
"miniflux.app/reader/feed"
|
||||
"miniflux.app/storage"
|
||||
"miniflux.app/template"
|
||||
"miniflux.app/worker"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/mitchellh/go-server-timing"
|
||||
)
|
||||
|
||||
// Serve declares all routes for the user interface.
|
||||
|
@ -23,6 +25,9 @@ func Serve(router *mux.Router, store *storage.Storage, pool *worker.Pool, feedHa
|
|||
uiRouter := router.NewRoute().Subrouter()
|
||||
uiRouter.Use(middleware.handleUserSession)
|
||||
uiRouter.Use(middleware.handleAppSession)
|
||||
uiRouter.Use(func(h http.Handler) http.Handler {
|
||||
return servertiming.Middleware(h, &servertiming.MiddlewareOpts{DisableHeaders: !config.Opts.HasServerTimingHeader()})
|
||||
})
|
||||
uiRouter.StrictSlash(true)
|
||||
|
||||
// Static assets.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue