1
0
Fork 0
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:
Clément Joly 2020-12-18 23:08:17 +00:00 committed by GitHub
parent 2cf9bde1af
commit f88e93a0b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 153 additions and 2 deletions

View file

@ -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.