MCPcopy Create free account
hub / github.com/evilsocket/pwngrid / cached

Function cached

api/setup_server.go:11–17  ·  view source on GitHub ↗
(seconds int, next http.HandlerFunc)

Source from the content-addressed store, hash-verified

9)
10
11func cached(seconds int, next http.HandlerFunc) http.HandlerFunc {
12 return func(w http.ResponseWriter, r *http.Request) {
13 w.Header().Add("Cache-Control", fmt.Sprintf("public, max-age=%d", seconds))
14 w.Header().Add("Expires", fmt.Sprintf("%d", seconds))
15 next.ServeHTTP(w, r)
16 }
17}
18
19func (api *API) setupServerRoutes() {
20 log.Debug("registering server api ...")

Callers 1

setupServerRoutesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected