MCPcopy Index your code
hub / github.com/syncthing/syncthing / noCacheMiddleware

Function noCacheMiddleware

lib/api/api.go:604–611  ·  view source on GitHub ↗
(h http.Handler)

Source from the content-addressed store, hash-verified

602}
603
604func noCacheMiddleware(h http.Handler) http.Handler {
605 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
606 w.Header().Set("Cache-Control", "max-age=0, no-cache, no-store")
607 w.Header().Set("Expires", time.Now().UTC().Format(http.TimeFormat))
608 w.Header().Set("Pragma", "no-cache")
609 h.ServeHTTP(w, r)
610 })
611}
612
613func withDetailsMiddleware(id protocol.DeviceID, h http.Handler) http.Handler {
614 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

Callers 1

ServeMethod · 0.85

Calls 4

NowMethod · 0.65
SetMethod · 0.45
HeaderMethod · 0.45
ServeHTTPMethod · 0.45

Tested by

no test coverage detected