fix golint issues in rest (#529)

This commit is contained in:
Kevin Wan
2021-03-01 19:15:35 +08:00
committed by GitHub
parent d894b88c3e
commit 655ae8034c
29 changed files with 132 additions and 32 deletions

View File

@@ -12,8 +12,10 @@ import (
const contentSecurity = "X-Content-Security"
// UnsignedCallback defines the method of the unsigned callback.
type UnsignedCallback func(w http.ResponseWriter, r *http.Request, next http.Handler, strict bool, code int)
// ContentSecurityHandler returns a middleware to verify content security.
func ContentSecurityHandler(decrypters map[string]codec.RsaDecrypter, tolerance time.Duration,
strict bool, callbacks ...UnsignedCallback) func(http.Handler) http.Handler {
if len(callbacks) == 0 {