Refuse recursive requests
Co-authored-by: Michael <michael.matur@gmail.com>
This commit is contained in:
parent
088fe3c270
commit
186e3e1541
17 changed files with 519 additions and 243 deletions
|
@ -349,7 +349,7 @@ func BuildTCPRouterConfiguration(ctx context.Context, configuration *dynamic.TCP
|
|||
continue
|
||||
}
|
||||
|
||||
if len(router.Service) == 0 {
|
||||
if router.Service == "" {
|
||||
if len(configuration.Services) > 1 {
|
||||
delete(configuration.Routers, routerName)
|
||||
loggerRouter.
|
||||
|
@ -368,7 +368,7 @@ func BuildTCPRouterConfiguration(ctx context.Context, configuration *dynamic.TCP
|
|||
func BuildUDPRouterConfiguration(ctx context.Context, configuration *dynamic.UDPConfiguration) {
|
||||
for routerName, router := range configuration.Routers {
|
||||
loggerRouter := log.FromContext(ctx).WithField(log.RouterName, routerName)
|
||||
if len(router.Service) > 0 {
|
||||
if router.Service != "" {
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -413,9 +413,12 @@ func BuildRouterConfiguration(ctx context.Context, configuration *dynamic.HTTPCo
|
|||
delete(configuration.Routers, routerName)
|
||||
continue
|
||||
}
|
||||
|
||||
// Flag default rule routers to add the denyRouterRecursion middleware.
|
||||
router.DefaultRule = true
|
||||
}
|
||||
|
||||
if len(router.Service) == 0 {
|
||||
if router.Service == "" {
|
||||
if len(configuration.Services) > 1 {
|
||||
delete(configuration.Routers, routerName)
|
||||
loggerRouter.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue