diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e1c2913e..be9bd798d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## [v2.3.6](https://github.com/traefik/traefik/tree/v2.3.6) (2020-12-17) +[All Commits](https://github.com/traefik/traefik/compare/v2.3.5...v2.3.6) + +**Bug fixes:** +- **[logs]** Update Logrus to v1.7.0 ([#7663](https://github.com/traefik/traefik/pull/7663) by [jspdown](https://github.com/jspdown)) +- **[plugins]** Update Yaegi to v0.9.8 ([#7659](https://github.com/traefik/traefik/pull/7659) by [ldez](https://github.com/ldez)) +- **[rules]** Disable router when a rule has an error ([#7680](https://github.com/traefik/traefik/pull/7680) by [ldez](https://github.com/ldez)) + +**Documentation:** +- **[logs]** Add configuration example for access log filePath ([#7655](https://github.com/traefik/traefik/pull/7655) by [wernerfred](https://github.com/wernerfred)) +- **[middleware]** Add missing quotes in errorpages k8s example yaml ([#7675](https://github.com/traefik/traefik/pull/7675) by [icelynjennings](https://github.com/icelynjennings)) + ## [v2.4.0-rc1](https://github.com/traefik/traefik/tree/v2.4.0-rc1) (2020-12-16) [All Commits](https://github.com/traefik/traefik/compare/v2.3.0-rc1...v2.4.0-rc1) diff --git a/pkg/rules/rules.go b/pkg/rules/rules.go index 469bcbe56..a6bfedb1b 100644 --- a/pkg/rules/rules.go +++ b/pkg/rules/rules.go @@ -59,7 +59,14 @@ func (r *Router) AddRoute(rule string, priority int, handler http.Handler) error } route := r.NewRoute().Handler(handler).Priority(priority) - return addRuleOnRoute(route, buildTree()) + + err = addRuleOnRoute(route, buildTree()) + if err != nil { + route.BuildOnly() + return err + } + + return nil } type tree struct { diff --git a/pkg/rules/rules_test.go b/pkg/rules/rules_test.go index a6a79eace..ca38ef28f 100644 --- a/pkg/rules/rules_test.go +++ b/pkg/rules/rules_test.go @@ -29,6 +29,16 @@ func Test_addRoute(t *testing.T) { rule: "rulewithnotmatcher", expectedError: true, }, + { + desc: "Host empty", + rule: "Host(``)", + expectedError: true, + }, + { + desc: "PathPrefix empty", + rule: "PathPrefix(``)", + expectedError: true, + }, { desc: "PathPrefix", rule: "PathPrefix(`/foo`)", diff --git a/pkg/server/router/router_test.go b/pkg/server/router/router_test.go index 722cae5a3..55db73ccc 100644 --- a/pkg/server/router/router_test.go +++ b/pkg/server/router/router_test.go @@ -62,6 +62,29 @@ func TestRouterManager_Get(t *testing.T) { entryPoints: []string{"web"}, expected: expectedResult{StatusCode: http.StatusOK}, }, + { + desc: "empty host", + routersConfig: map[string]*dynamic.Router{ + "foo": { + EntryPoints: []string{"web"}, + Service: "foo-service", + Rule: "Host(``)", + }, + }, + serviceConfig: map[string]*dynamic.Service{ + "foo-service": { + LoadBalancer: &dynamic.ServersLoadBalancer{ + Servers: []dynamic.Server{ + { + URL: server.URL, + }, + }, + }, + }, + }, + entryPoints: []string{"web"}, + expected: expectedResult{StatusCode: http.StatusNotFound}, + }, { desc: "no load balancer", routersConfig: map[string]*dynamic.Router{ diff --git a/script/gcg/traefik-bugfix.toml b/script/gcg/traefik-bugfix.toml index 408b454d1..01c1e79c1 100644 --- a/script/gcg/traefik-bugfix.toml +++ b/script/gcg/traefik-bugfix.toml @@ -6,9 +6,9 @@ FileName = "traefik_changelog.md" # example new bugfix v2.3.5 CurrentRef = "v2.3" -PreviousRef = "v2.3.4" +PreviousRef = "v2.3.5" BaseBranch = "v2.3" -FutureCurrentRefName = "v2.3.5" +FutureCurrentRefName = "v2.3.6" ThresholdPreviousRef = 10 ThresholdCurrentRef = 10