Archived
Template
1
0
This repository has been archived on 2023-12-20. You can view files and clone it, but cannot push or open issues or pull requests.
Files
golang-base-project/middleware/sensitive.go
2021-12-12 14:56:13 +01:00

15 lines
346 B
Go

package middleware
import (
"github.com/gin-gonic/gin"
)
// Sensitive middleware handles headers that should be set for routes that may contain sensitive data such as personal information
func Sensitive() gin.HandlerFunc {
return func(c *gin.Context) {
c.Header("Cache-control", "no-store")
c.Header("Pragma", "no-cache")
c.Next()
}
}