mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-22 21:39:08 +02:00
add trace logs
This commit is contained in:
@@ -9,9 +9,11 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/netbirdio/netbird/proxy/auth"
|
log "github.com/sirupsen/logrus"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
|
|
||||||
|
"github.com/netbirdio/netbird/proxy/auth"
|
||||||
|
|
||||||
"github.com/netbirdio/netbird/proxy/web"
|
"github.com/netbirdio/netbird/proxy/web"
|
||||||
"github.com/netbirdio/netbird/shared/management/proto"
|
"github.com/netbirdio/netbird/shared/management/proto"
|
||||||
)
|
)
|
||||||
@@ -67,6 +69,8 @@ func (mw *Middleware) Protect(next http.Handler) http.Handler {
|
|||||||
config, exists := mw.domains[host]
|
config, exists := mw.domains[host]
|
||||||
mw.domainsMux.RUnlock()
|
mw.domainsMux.RUnlock()
|
||||||
|
|
||||||
|
log.Tracef("checking authentication for host: %s, exists: %t", host, exists)
|
||||||
|
|
||||||
// Domains that are not configured here or have no authentication schemes applied should simply pass through.
|
// Domains that are not configured here or have no authentication schemes applied should simply pass through.
|
||||||
if !exists || len(config.Schemes) == 0 {
|
if !exists || len(config.Schemes) == 0 {
|
||||||
next.ServeHTTP(w, r)
|
next.ServeHTTP(w, r)
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import (
|
|||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
|
|
||||||
"github.com/netbirdio/netbird/proxy/internal/types"
|
"github.com/netbirdio/netbird/proxy/internal/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -35,6 +37,7 @@ func (p *ReverseProxy) findTargetForRequest(req *http.Request) (*url.URL, string
|
|||||||
host = h
|
host = h
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.Tracef("looking for mapping for host: %s, path: %s", host, req.URL.Path)
|
||||||
m, exists := p.mappings[host]
|
m, exists := p.mappings[host]
|
||||||
if !exists {
|
if !exists {
|
||||||
return nil, "", "", false
|
return nil, "", "", false
|
||||||
|
|||||||
Reference in New Issue
Block a user