add simple logs

This commit is contained in:
Mohamad Tahir 2023-10-30 14:52:36 +03:00
parent 149616a5ad
commit fb7dce9887
Signed by: MohamadTahir
GPG Key ID: 116FAB02D35512FA

View File

@ -4,6 +4,7 @@ import (
"context" "context"
"fmt" "fmt"
"net/http" "net/http"
"os"
"strings" "strings"
) )
@ -53,6 +54,12 @@ func New(ctx context.Context, next http.Handler, config *Config, name string) (h
func (a *UsersBlocker) ServeHTTP(rw http.ResponseWriter, req *http.Request) { func (a *UsersBlocker) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
userId := req.Header["X-Auth-User-Id"][0] userId := req.Header["X-Auth-User-Id"][0]
os.Stdout.WriteString("request Path ->")
os.Stdout.WriteString(req.URL.Path)
os.Stdout.WriteString("userId ->")
os.Stdout.WriteString(userId)
var isUserBlocked bool var isUserBlocked bool
for _, id := range a.userId { for _, id := range a.userId {