diff --git a/internal/webui/server.go b/internal/webui/server.go index 7e3e4a80c..ece780979 100644 --- a/internal/webui/server.go +++ b/internal/webui/server.go @@ -17,6 +17,7 @@ import ( "github.com/samcharles93/archie-core/internal/domain/messaging" "github.com/samcharles93/archie-core/internal/domain/storecontract" "github.com/samcharles93/archie-core/internal/events" + "github.com/samcharles93/archie-core/internal/infrastructure/captureintake" "github.com/samcharles93/archie-core/internal/logging" "github.com/samcharles93/archie-core/ui" ) @@ -338,7 +339,10 @@ func (s *Server) Handler() http.Handler { top.HandleFunc(loginCallbackRoute, s.handleCallback) } if s.CaptureIntake != nil { - top.Handle(captureIntakeRoute, s.CaptureIntake) + // captureintake.Path is the single spelling of this route: the receiver + // owns the route's semantics, so mounting re-spells nothing and a rename + // there cannot silently unmount here. + top.Handle(captureintake.Path, s.CaptureIntake) } // The chain runs after the credential check and before any handler: the // principal exists only once the credential resolved @@ -347,12 +351,6 @@ func (s *Server) Handler() http.Handler { return top } -// captureIntakeRoute is the bypass-mux route the host process's capture -// receiver mounts on. captureintake.Path is the authority for the route's -// semantics; this literal exists so webui can mount an http.Handler without -// depending on the receiver's concrete package. -const captureIntakeRoute = "POST /webhooks/capture/{source}" - // handleHealthz is a liveness probe for local, unauthenticated callers -- // most notably the update watchdog script, which polls it after restarting // archied to decide whether the new version came up or the update needs to