mirror of
https://github.com/PrivateCaptcha/PrivateCaptcha.git
synced 2026-02-09 07:19:08 -06:00
Remove unused code
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -102,20 +101,6 @@ func SetupTraceLogs() {
|
||||
slog.SetDefault(logger)
|
||||
}
|
||||
|
||||
func FindHeader(headers map[string]string, header string) (string, bool) {
|
||||
requestID, ok := headers[header]
|
||||
if ok {
|
||||
return requestID, ok
|
||||
}
|
||||
|
||||
requestID, ok = headers[strings.ToLower(header)]
|
||||
if ok {
|
||||
return requestID, ok
|
||||
}
|
||||
|
||||
return "", false
|
||||
}
|
||||
|
||||
func ErrAttr(err error) slog.Attr {
|
||||
return slog.Any("error", err)
|
||||
}
|
||||
|
||||
@@ -117,13 +117,6 @@ func Cached(next http.Handler) http.Handler {
|
||||
})
|
||||
}
|
||||
|
||||
func NoCache(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
WriteHeaders(w, NoCacheHeaders)
|
||||
next.ServeHTTP(w, r)
|
||||
})
|
||||
}
|
||||
|
||||
func HttpStatus(code int) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
w.WriteHeader(code)
|
||||
|
||||
Reference in New Issue
Block a user