MCPcopy
hub / github.com/yusing/godoxy / NoCache

Function NoCache

internal/api/handler.go:180–190  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

178}
179
180func NoCache() gin.HandlerFunc {
181 return func(c *gin.Context) {
182 // skip cache if Cache-Control header is set
183 if c.Writer.Header().Get("Cache-Control") == "" {
184 c.Header("Cache-Control", "no-cache, no-store, must-revalidate")
185 c.Header("Pragma", "no-cache")
186 c.Header("Expires", "0")
187 }
188 c.Next()
189 }
190}
191
192func AuthMiddleware() gin.HandlerFunc {
193 return func(c *gin.Context) {

Callers 2

newAPIHandlerFunction · 0.92
NewHandlerFunction · 0.85

Calls 2

GetMethod · 0.65
HeaderMethod · 0.45

Tested by

no test coverage detected