1
0
Fork 0

added debugging information about the demains

Dieser Commit ist enthalten in:
Sebastian Tobie 2021-01-23 12:00:51 +01:00
Ursprung e6794c7c98
Commit 2c798d6006
1 geänderte Dateien mit 3 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -56,13 +56,16 @@ func (s *Server) StartServer() {
// DomainRouter redirects the requests to the routers of the domains // DomainRouter redirects the requests to the routers of the domains
func (s *Server) DomainRouter(c *gin.Context) { func (s *Server) DomainRouter(c *gin.Context) {
domain := c.Request.URL.Host domain := c.Request.URL.Host
entry := log.Trace().Str("domain", domain)
if router, found := s.mrouter[domain]; found { if router, found := s.mrouter[domain]; found {
entry.Msg("Found domain")
router.NoMethod(s.NotFoundHandler) router.NoMethod(s.NotFoundHandler)
router.NoRoute(s.NotFoundHandler) router.NoRoute(s.NotFoundHandler)
c.Set("domain", domain) c.Set("domain", domain)
router.HandleContext(c) router.HandleContext(c)
return return
} }
entry.Interface("domains", s.mrouter).Msg("domain not found")
s.NotFoundHandler(c) s.NotFoundHandler(c)
} }