mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-23 09:18:51 +02:00
fix(rules): uncomment code
This commit is contained in:
@@ -10,11 +10,13 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/rs/zerolog"
|
"github.com/rs/zerolog"
|
||||||
|
entrypoint "github.com/yusing/godoxy/internal/entrypoint/types"
|
||||||
"github.com/yusing/godoxy/internal/logging"
|
"github.com/yusing/godoxy/internal/logging"
|
||||||
gphttp "github.com/yusing/godoxy/internal/net/gphttp"
|
gphttp "github.com/yusing/godoxy/internal/net/gphttp"
|
||||||
nettypes "github.com/yusing/godoxy/internal/net/types"
|
nettypes "github.com/yusing/godoxy/internal/net/types"
|
||||||
"github.com/yusing/godoxy/internal/notif"
|
"github.com/yusing/godoxy/internal/notif"
|
||||||
"github.com/yusing/godoxy/internal/route/routes"
|
"github.com/yusing/godoxy/internal/route/routes"
|
||||||
|
"github.com/yusing/godoxy/internal/types"
|
||||||
gperr "github.com/yusing/goutils/errs"
|
gperr "github.com/yusing/goutils/errs"
|
||||||
httputils "github.com/yusing/goutils/http"
|
httputils "github.com/yusing/goutils/http"
|
||||||
"github.com/yusing/goutils/http/reverseproxy"
|
"github.com/yusing/goutils/http/reverseproxy"
|
||||||
@@ -194,23 +196,21 @@ var commands = map[string]struct {
|
|||||||
return args[0], nil
|
return args[0], nil
|
||||||
},
|
},
|
||||||
build: func(args any) CommandHandler {
|
build: func(args any) CommandHandler {
|
||||||
// route := args.(string)
|
route := args.(string)
|
||||||
return TerminatingCommand(func(w http.ResponseWriter, req *http.Request) error {
|
return TerminatingCommand(func(w http.ResponseWriter, req *http.Request) error {
|
||||||
|
ep := entrypoint.FromCtx(req.Context())
|
||||||
// FIXME: circular dependency
|
r, ok := ep.HTTPRoutes().Get(route)
|
||||||
// ep := entrypoint.FromCtx(req.Context())
|
if !ok {
|
||||||
// r, ok := ep.HTTPRoutes().Get(route)
|
excluded, has := ep.ExcludedRoutes().Get(route)
|
||||||
// if !ok {
|
if has {
|
||||||
// excluded, has := ep.ExcludedRoutes().Get(route)
|
r, ok = excluded.(types.HTTPRoute)
|
||||||
// if has {
|
}
|
||||||
// r, ok = excluded.(types.HTTPRoute)
|
}
|
||||||
// }
|
if ok {
|
||||||
// }
|
r.ServeHTTP(w, req)
|
||||||
// if ok {
|
} else {
|
||||||
// r.ServeHTTP(w, req)
|
http.Error(w, fmt.Sprintf("Route %q not found", route), http.StatusNotFound)
|
||||||
// } else {
|
}
|
||||||
// http.Error(w, fmt.Sprintf("Route %q not found", route), http.StatusNotFound)
|
|
||||||
// }
|
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user