mirror of
https://github.com/ditkrg/traefik-users-blocker-plugin.git
synced 2026-01-22 23:16:39 +00:00
add simple logs
This commit is contained in:
parent
149616a5ad
commit
fb7dce9887
7
main.go
7
main.go
@ -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 {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user