fix: 优化代码

This commit is contained in:
tbphp
2025-06-09 22:03:15 +08:00
parent 0c5cf4266d
commit 9562f0f6dd
5 changed files with 48 additions and 46 deletions

View File

@@ -125,11 +125,10 @@ func setupRoutes(handlers *handler.Handler, proxyServer *proxy.ProxyServer, conf
router.GET("/reset-keys", handlers.ResetKeys)
router.GET("/config", handlers.GetConfig) // Debug endpoint
// Handle 404 and 405
router.NoRoute(handlers.NotFound)
// Handle 405 Method Not Allowed
router.NoMethod(handlers.MethodNotAllowed)
// Proxy all other requests
// Proxy all other requests (this handles 404 as well)
router.NoRoute(proxyServer.HandleProxy)
return router