| 602 | } |
| 603 | |
| 604 | func 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 | |
| 613 | func withDetailsMiddleware(id protocol.DeviceID, h http.Handler) http.Handler { |
| 614 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |