diff options
Diffstat (limited to 'internal/proxy')
| -rw-r--r-- | internal/proxy/proxy.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/internal/proxy/proxy.go b/internal/proxy/proxy.go index 216e947..2e80ed2 100644 --- a/internal/proxy/proxy.go +++ b/internal/proxy/proxy.go @@ -38,6 +38,7 @@ import ( "mitmux/internal/ca" "mitmux/internal/rules" + "mitmux/internal/scope" "mitmux/internal/store" ) @@ -509,6 +510,18 @@ func (s *Server) record(started time.Time, duration time.Duration, scheme, host if s.store == nil { return } + // Scope only filters what gets recorded here - the request has + // already been forwarded and its response already written to the + // client by the time record() runs (see forward()), so an + // out-of-scope host still proxies completely normally, it just + // doesn't clutter history. Repeat/Intrude (recordRaw, a different + // function) deliberately don't go through this check: a user + // explicitly resending or fuzzing a specific request wants to see + // the result regardless of scope, which exists to cut passive- + // capture noise, not to second-guess a deliberate action. + if scopeRules, err := s.store.ListScopeRules(); err == nil && !scope.InScope(scopeRules, host) { + return + } e := &store.Entry{ StartedAt: started, |