Skip to content

Commit 3539b07

Browse files
Add some logging
1 parent 1be6199 commit 3539b07

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

header_auth.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ type HeaderAuth struct {
2626
}
2727

2828
func New(ctx context.Context, next http.Handler, config *Config, name string) (http.Handler, error) {
29+
fmt.Printf("Creating plugin: %s instance: %+v, ctx: %+v\n", name, *config, ctx)
2930
if len(config.Header) == 0 {
3031
return nil, fmt.Errorf("headers cannot be empty")
3132
}
@@ -42,6 +43,7 @@ func (a *HeaderAuth) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
4243
fmt.Println("SUCCESS")
4344
req.Header.Del(a.header["name"])
4445
a.next.ServeHTTP(rw, req)
46+
return
4547
}
4648
fmt.Println("FAILED")
4749
http.Error(rw, "Not allowed - verified null", http.StatusUnauthorized)

0 commit comments

Comments
 (0)