diff options
| author | mhsanaei <ho3ein.sanaei@gmail.com> | 2025-09-24 22:30:58 +0300 |
|---|---|---|
| committer | mhsanaei <ho3ein.sanaei@gmail.com> | 2025-09-24 22:30:58 +0300 |
| commit | 89def9aee67739f3934349e9aa33f2aa8f5d941d (patch) | |
| tree | ff8c0e8f4b47596898d5b775b0ac54adc21d6e99 /web | |
| parent | b2b002464826e5ef6d6864756e7ec9beb431d7e4 (diff) | |
fix
Diffstat (limited to 'web')
| -rw-r--r-- | web/web.go | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -266,6 +266,11 @@ func (s *Server) initRouter() (*gin.Engine, error) { s.panel = controller.NewXUIController(g) s.api = controller.NewAPIController(g) + // Add a catch-all route to handle undefined paths and return 404 + engine.NoRoute(func(c *gin.Context) { + c.AbortWithStatus(http.StatusNotFound) + }) + return engine, nil } |
