Disable RateLimit temporarily

This commit is contained in:
Julien Salleyron 2019-07-19 10:50:05 +02:00 committed by Traefiker Bot
parent d5f4934acf
commit e3627e9cba
12 changed files with 122 additions and 144 deletions

View file

@ -1,5 +1,8 @@
# RateLimit # RateLimit
!!! warning
This middleware is disable for now.
Protection from Too Many Calls Protection from Too Many Calls
{: .subtitle } {: .subtitle }

View file

@ -186,18 +186,6 @@
commonName = true commonName = true
serialNumber = true serialNumber = true
domainComponent = true domainComponent = true
[http.middlewares.Middleware13]
[http.middlewares.Middleware13.rateLimit]
extractorFunc = "foobar"
[http.middlewares.Middleware13.rateLimit.rateSet]
[http.middlewares.Middleware13.rateLimit.rateSet.Rate0]
period = "42ns"
average = 42
burst = 42
[http.middlewares.Middleware13.rateLimit.rateSet.Rate1]
period = "42ns"
average = 42
burst = 42
[http.middlewares.Middleware14] [http.middlewares.Middleware14]
[http.middlewares.Middleware14.redirectRegex] [http.middlewares.Middleware14.redirectRegex]
regex = "foobar" regex = "foobar"

View file

@ -212,18 +212,6 @@ http:
commonName: true commonName: true
serialNumber: true serialNumber: true
domainComponent: true domainComponent: true
Middleware13:
rateLimit:
rateSet:
Rate0:
period: 42ns
average: 42
burst: 42
Rate1:
period: 42ns
average: 42
burst: 42
extractorFunc: foobar
Middleware14: Middleware14:
redirectRegex: redirectRegex:
regex: foobar regex: foobar

View file

@ -83,13 +83,6 @@
- "traefik.http.middlewares.middleware12.passtlsclientcert.info.subject.province=true" - "traefik.http.middlewares.middleware12.passtlsclientcert.info.subject.province=true"
- "traefik.http.middlewares.middleware12.passtlsclientcert.info.subject.serialnumber=true" - "traefik.http.middlewares.middleware12.passtlsclientcert.info.subject.serialnumber=true"
- "traefik.http.middlewares.middleware12.passtlsclientcert.pem=true" - "traefik.http.middlewares.middleware12.passtlsclientcert.pem=true"
- "traefik.http.middlewares.middleware13.ratelimit.extractorfunc=foobar"
- "traefik.http.middlewares.middleware13.ratelimit.rateset.rate0.average=42"
- "traefik.http.middlewares.middleware13.ratelimit.rateset.rate0.burst=42"
- "traefik.http.middlewares.middleware13.ratelimit.rateset.rate0.period=42"
- "traefik.http.middlewares.middleware13.ratelimit.rateset.rate1.average=42"
- "traefik.http.middlewares.middleware13.ratelimit.rateset.rate1.burst=42"
- "traefik.http.middlewares.middleware13.ratelimit.rateset.rate1.period=42"
- "traefik.http.middlewares.middleware14.redirectregex.permanent=true" - "traefik.http.middlewares.middleware14.redirectregex.permanent=true"
- "traefik.http.middlewares.middleware14.redirectregex.regex=foobar" - "traefik.http.middlewares.middleware14.redirectregex.regex=foobar"
- "traefik.http.middlewares.middleware14.redirectregex.replacement=foobar" - "traefik.http.middlewares.middleware14.redirectregex.replacement=foobar"

View file

@ -309,6 +309,8 @@ func (s *AccessLogSuite) TestAccessLogFrontendRedirect(c *check.C) {
} }
func (s *AccessLogSuite) TestAccessLogRateLimit(c *check.C) { func (s *AccessLogSuite) TestAccessLogRateLimit(c *check.C) {
c.Skip("RateLimit is disable for now")
ensureWorkingDirectoryIsClean() ensureWorkingDirectoryIsClean()
expected := []accessLogValue{ expected := []accessLogValue{

View file

@ -54,7 +54,8 @@ func init() {
check.Suite(&LogRotationSuite{}) check.Suite(&LogRotationSuite{})
check.Suite(&MarathonSuite{}) check.Suite(&MarathonSuite{})
check.Suite(&MarathonSuite15{}) check.Suite(&MarathonSuite15{})
check.Suite(&RateLimitSuite{}) // TODO: disable temporarily
// check.Suite(&RateLimitSuite{})
check.Suite(&RestSuite{}) check.Suite(&RestSuite{})
check.Suite(&RetrySuite{}) check.Suite(&RetrySuite{})
check.Suite(&SimpleSuite{}) check.Suite(&SimpleSuite{})

View file

@ -55,18 +55,19 @@ frontendRedirect:
- traefik.http.middlewares.redirecthttp.redirectScheme.scheme=http - traefik.http.middlewares.redirecthttp.redirectScheme.scheme=http
- traefik.http.middlewares.redirecthttp.redirectScheme.port=8000 - traefik.http.middlewares.redirecthttp.redirectScheme.port=8000
- traefik.http.services.service3.loadbalancer.server.port=80 - traefik.http.services.service3.loadbalancer.server.port=80
rateLimit: # TODO: disable temporarily (rateLimit)
image: containous/whoami #rateLimit:
labels: # image: containous/whoami
- traefik.enable=true # labels:
- traefik.http.routers.rt-rateLimit.entryPoints=httpRateLimit # - traefik.enable=true
- traefik.http.routers.rt-rateLimit.rule=Host("ratelimit.docker.local") # - traefik.http.routers.rt-rateLimit.entryPoints=httpRateLimit
- traefik.http.routers.rt-rateLimit.middlewares=rate # - traefik.http.routers.rt-rateLimit.rule=Host("ratelimit.docker.local")
- traefik.http.middlewares.rate.ratelimit.extractorfunc=client.ip # - traefik.http.routers.rt-rateLimit.middlewares=rate
- traefik.http.middlewares.rate.ratelimit.rateset.Rate0.average=1 # - traefik.http.middlewares.rate.ratelimit.extractorfunc=client.ip
- traefik.http.middlewares.rate.ratelimit.rateset.Rate0.burst=2 # - traefik.http.middlewares.rate.ratelimit.rateset.Rate0.average=1
- traefik.http.middlewares.rate.ratelimit.rateset.Rate0.period=10s # - traefik.http.middlewares.rate.ratelimit.rateset.Rate0.burst=2
- traefik.http.services.service3.loadbalancer.server.port=80 # - traefik.http.middlewares.rate.ratelimit.rateset.Rate0.period=10s
# - traefik.http.services.service3.loadbalancer.server.port=80
frontendWhitelist: frontendWhitelist:
image: containous/whoami image: containous/whoami
labels: labels:

View file

@ -41,6 +41,8 @@ func (s *TracingSuite) startZipkin(c *check.C) {
} }
func (s *TracingSuite) TestZipkinRateLimit(c *check.C) { func (s *TracingSuite) TestZipkinRateLimit(c *check.C) {
c.Skip("RateLimit is disable for now")
s.startZipkin(c) s.startZipkin(c)
defer s.composeProject.Stop(c, "zipkin") defer s.composeProject.Stop(c, "zipkin")
file := s.adaptFile(c, "fixtures/tracing/simple-zipkin.toml", TracingTemplate{ file := s.adaptFile(c, "fixtures/tracing/simple-zipkin.toml", TracingTemplate{
@ -155,6 +157,8 @@ func (s *TracingSuite) startJaeger(c *check.C) {
} }
func (s *TracingSuite) TestJaegerRateLimit(c *check.C) { func (s *TracingSuite) TestJaegerRateLimit(c *check.C) {
c.Skip("RateLimit is disable for now")
s.startJaeger(c) s.startJaeger(c)
defer s.composeProject.Stop(c, "jaeger") defer s.composeProject.Stop(c, "jaeger")
file := s.adaptFile(c, "fixtures/tracing/simple-jaeger.toml", TracingTemplate{ file := s.adaptFile(c, "fixtures/tracing/simple-jaeger.toml", TracingTemplate{

View file

@ -15,16 +15,17 @@ import (
// Middleware holds the Middleware configuration. // Middleware holds the Middleware configuration.
type Middleware struct { type Middleware struct {
AddPrefix *AddPrefix `json:"addPrefix,omitempty" toml:"addPrefix,omitempty" yaml:"addPrefix,omitempty"` AddPrefix *AddPrefix `json:"addPrefix,omitempty" toml:"addPrefix,omitempty" yaml:"addPrefix,omitempty"`
StripPrefix *StripPrefix `json:"stripPrefix,omitempty" toml:"stripPrefix,omitempty" yaml:"stripPrefix,omitempty"` StripPrefix *StripPrefix `json:"stripPrefix,omitempty" toml:"stripPrefix,omitempty" yaml:"stripPrefix,omitempty"`
StripPrefixRegex *StripPrefixRegex `json:"stripPrefixRegex,omitempty" toml:"stripPrefixRegex,omitempty" yaml:"stripPrefixRegex,omitempty"` StripPrefixRegex *StripPrefixRegex `json:"stripPrefixRegex,omitempty" toml:"stripPrefixRegex,omitempty" yaml:"stripPrefixRegex,omitempty"`
ReplacePath *ReplacePath `json:"replacePath,omitempty" toml:"replacePath,omitempty" yaml:"replacePath,omitempty"` ReplacePath *ReplacePath `json:"replacePath,omitempty" toml:"replacePath,omitempty" yaml:"replacePath,omitempty"`
ReplacePathRegex *ReplacePathRegex `json:"replacePathRegex,omitempty" toml:"replacePathRegex,omitempty" yaml:"replacePathRegex,omitempty"` ReplacePathRegex *ReplacePathRegex `json:"replacePathRegex,omitempty" toml:"replacePathRegex,omitempty" yaml:"replacePathRegex,omitempty"`
Chain *Chain `json:"chain,omitempty" toml:"chain,omitempty" yaml:"chain,omitempty"` Chain *Chain `json:"chain,omitempty" toml:"chain,omitempty" yaml:"chain,omitempty"`
IPWhiteList *IPWhiteList `json:"ipWhiteList,omitempty" toml:"ipWhiteList,omitempty" yaml:"ipWhiteList,omitempty"` IPWhiteList *IPWhiteList `json:"ipWhiteList,omitempty" toml:"ipWhiteList,omitempty" yaml:"ipWhiteList,omitempty"`
Headers *Headers `json:"headers,omitempty" toml:"headers,omitempty" yaml:"headers,omitempty"` Headers *Headers `json:"headers,omitempty" toml:"headers,omitempty" yaml:"headers,omitempty"`
Errors *ErrorPage `json:"errors,omitempty" toml:"errors,omitempty" yaml:"errors,omitempty"` Errors *ErrorPage `json:"errors,omitempty" toml:"errors,omitempty" yaml:"errors,omitempty"`
RateLimit *RateLimit `json:"rateLimit,omitempty" toml:"rateLimit,omitempty" yaml:"rateLimit,omitempty"` // TODO: disable temporarily
// RateLimit *RateLimit `json:"rateLimit,omitempty" toml:"rateLimit,omitempty" yaml:"rateLimit,omitempty"`
RedirectRegex *RedirectRegex `json:"redirectRegex,omitempty" toml:"redirectRegex,omitempty" yaml:"redirectRegex,omitempty"` RedirectRegex *RedirectRegex `json:"redirectRegex,omitempty" toml:"redirectRegex,omitempty" yaml:"redirectRegex,omitempty"`
RedirectScheme *RedirectScheme `json:"redirectScheme,omitempty" toml:"redirectScheme,omitempty" yaml:"redirectScheme,omitempty"` RedirectScheme *RedirectScheme `json:"redirectScheme,omitempty" toml:"redirectScheme,omitempty" yaml:"redirectScheme,omitempty"`
BasicAuth *BasicAuth `json:"basicAuth,omitempty" toml:"basicAuth,omitempty" yaml:"basicAuth,omitempty"` BasicAuth *BasicAuth `json:"basicAuth,omitempty" toml:"basicAuth,omitempty" yaml:"basicAuth,omitempty"`

View file

@ -628,11 +628,6 @@ func (in *Middleware) DeepCopyInto(out *Middleware) {
*out = new(ErrorPage) *out = new(ErrorPage)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
if in.RateLimit != nil {
in, out := &in.RateLimit, &out.RateLimit
*out = new(RateLimit)
(*in).DeepCopyInto(*out)
}
if in.RedirectRegex != nil { if in.RedirectRegex != nil {
in, out := &in.RedirectRegex, &out.RedirectRegex in, out := &in.RedirectRegex, &out.RedirectRegex
*out = new(RedirectRegex) *out = new(RedirectRegex)

View file

@ -3,10 +3,8 @@ package label
import ( import (
"fmt" "fmt"
"testing" "testing"
"time"
"github.com/containous/traefik/pkg/config/dynamic" "github.com/containous/traefik/pkg/config/dynamic"
"github.com/containous/traefik/pkg/types"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )
@ -97,26 +95,27 @@ func TestDecodeConfiguration(t *testing.T) {
"traefik.http.middlewares.Middleware11.passtlsclientcert.info.issuer.province": "true", "traefik.http.middlewares.Middleware11.passtlsclientcert.info.issuer.province": "true",
"traefik.http.middlewares.Middleware11.passtlsclientcert.info.issuer.serialnumber": "true", "traefik.http.middlewares.Middleware11.passtlsclientcert.info.issuer.serialnumber": "true",
"traefik.http.middlewares.Middleware11.passtlsclientcert.pem": "true", "traefik.http.middlewares.Middleware11.passtlsclientcert.pem": "true",
"traefik.http.middlewares.Middleware12.ratelimit.extractorfunc": "foobar", // TODO: disable temporarily (rateLimit)
"traefik.http.middlewares.Middleware12.ratelimit.rateset.Rate0.average": "42", // "traefik.http.middlewares.Middleware12.ratelimit.extractorfunc": "foobar",
"traefik.http.middlewares.Middleware12.ratelimit.rateset.Rate0.burst": "42", // "traefik.http.middlewares.Middleware12.ratelimit.rateset.Rate0.average": "42",
"traefik.http.middlewares.Middleware12.ratelimit.rateset.Rate0.period": "42", // "traefik.http.middlewares.Middleware12.ratelimit.rateset.Rate0.burst": "42",
"traefik.http.middlewares.Middleware12.ratelimit.rateset.Rate1.average": "42", // "traefik.http.middlewares.Middleware12.ratelimit.rateset.Rate0.period": "42",
"traefik.http.middlewares.Middleware12.ratelimit.rateset.Rate1.burst": "42", // "traefik.http.middlewares.Middleware12.ratelimit.rateset.Rate1.average": "42",
"traefik.http.middlewares.Middleware12.ratelimit.rateset.Rate1.period": "42", // "traefik.http.middlewares.Middleware12.ratelimit.rateset.Rate1.burst": "42",
"traefik.http.middlewares.Middleware13.redirectregex.permanent": "true", // "traefik.http.middlewares.Middleware12.ratelimit.rateset.Rate1.period": "42",
"traefik.http.middlewares.Middleware13.redirectregex.regex": "foobar", "traefik.http.middlewares.Middleware13.redirectregex.permanent": "true",
"traefik.http.middlewares.Middleware13.redirectregex.replacement": "foobar", "traefik.http.middlewares.Middleware13.redirectregex.regex": "foobar",
"traefik.http.middlewares.Middleware13b.redirectscheme.scheme": "https", "traefik.http.middlewares.Middleware13.redirectregex.replacement": "foobar",
"traefik.http.middlewares.Middleware13b.redirectscheme.port": "80", "traefik.http.middlewares.Middleware13b.redirectscheme.scheme": "https",
"traefik.http.middlewares.Middleware13b.redirectscheme.permanent": "true", "traefik.http.middlewares.Middleware13b.redirectscheme.port": "80",
"traefik.http.middlewares.Middleware14.replacepath.path": "foobar", "traefik.http.middlewares.Middleware13b.redirectscheme.permanent": "true",
"traefik.http.middlewares.Middleware15.replacepathregex.regex": "foobar", "traefik.http.middlewares.Middleware14.replacepath.path": "foobar",
"traefik.http.middlewares.Middleware15.replacepathregex.replacement": "foobar", "traefik.http.middlewares.Middleware15.replacepathregex.regex": "foobar",
"traefik.http.middlewares.Middleware16.retry.attempts": "42", "traefik.http.middlewares.Middleware15.replacepathregex.replacement": "foobar",
"traefik.http.middlewares.Middleware17.stripprefix.prefixes": "foobar, fiibar", "traefik.http.middlewares.Middleware16.retry.attempts": "42",
"traefik.http.middlewares.Middleware18.stripprefixregex.regex": "foobar, fiibar", "traefik.http.middlewares.Middleware17.stripprefix.prefixes": "foobar, fiibar",
"traefik.http.middlewares.Middleware19.compress": "true", "traefik.http.middlewares.Middleware18.stripprefixregex.regex": "foobar, fiibar",
"traefik.http.middlewares.Middleware19.compress": "true",
"traefik.http.routers.Router0.entrypoints": "foobar, fiibar", "traefik.http.routers.Router0.entrypoints": "foobar, fiibar",
"traefik.http.routers.Router0.middlewares": "foobar, fiibar", "traefik.http.routers.Router0.middlewares": "foobar, fiibar",
@ -306,23 +305,24 @@ func TestDecodeConfiguration(t *testing.T) {
}, },
}, },
}, },
"Middleware12": { // TODO: disable temporarily (rateLimit)
RateLimit: &dynamic.RateLimit{ // "Middleware12": {
RateSet: map[string]*dynamic.Rate{ // RateLimit: &dynamic.RateLimit{
"Rate0": { // RateSet: map[string]*dynamic.Rate{
Period: types.Duration(42 * time.Second), // "Rate0": {
Average: 42, // Period: types.Duration(42 * time.Second),
Burst: 42, // Average: 42,
}, // Burst: 42,
"Rate1": { // },
Period: types.Duration(42 * time.Second), // "Rate1": {
Average: 42, // Period: types.Duration(42 * time.Second),
Burst: 42, // Average: 42,
}, // Burst: 42,
}, // },
ExtractorFunc: "foobar", // },
}, // ExtractorFunc: "foobar",
}, // },
// },
"Middleware13": { "Middleware13": {
RedirectRegex: &dynamic.RedirectRegex{ RedirectRegex: &dynamic.RedirectRegex{
Regex: "foobar", Regex: "foobar",
@ -702,23 +702,24 @@ func TestEncodeConfiguration(t *testing.T) {
}, },
}, },
}, },
"Middleware12": { // TODO: disable temporarily (rateLimit)
RateLimit: &dynamic.RateLimit{ // "Middleware12": {
RateSet: map[string]*dynamic.Rate{ // RateLimit: &dynamic.RateLimit{
"Rate0": { // RateSet: map[string]*dynamic.Rate{
Period: types.Duration(42 * time.Nanosecond), // "Rate0": {
Average: 42, // Period: types.Duration(42 * time.Nanosecond),
Burst: 42, // Average: 42,
}, // Burst: 42,
"Rate1": { // },
Period: types.Duration(42 * time.Nanosecond), // "Rate1": {
Average: 42, // Period: types.Duration(42 * time.Nanosecond),
Burst: 42, // Average: 42,
}, // Burst: 42,
}, // },
ExtractorFunc: "foobar", // },
}, // ExtractorFunc: "foobar",
}, // },
// },
"Middleware13": { "Middleware13": {
RedirectRegex: &dynamic.RedirectRegex{ RedirectRegex: &dynamic.RedirectRegex{
Regex: "foobar", Regex: "foobar",
@ -1051,26 +1052,27 @@ func TestEncodeConfiguration(t *testing.T) {
"traefik.HTTP.Middlewares.Middleware11.PassTLSClientCert.Info.Issuer.SerialNumber": "true", "traefik.HTTP.Middlewares.Middleware11.PassTLSClientCert.Info.Issuer.SerialNumber": "true",
"traefik.HTTP.Middlewares.Middleware11.PassTLSClientCert.Info.Issuer.DomainComponent": "true", "traefik.HTTP.Middlewares.Middleware11.PassTLSClientCert.Info.Issuer.DomainComponent": "true",
"traefik.HTTP.Middlewares.Middleware11.PassTLSClientCert.PEM": "true", "traefik.HTTP.Middlewares.Middleware11.PassTLSClientCert.PEM": "true",
"traefik.HTTP.Middlewares.Middleware12.RateLimit.ExtractorFunc": "foobar", // TODO: disable temporarily (rateLimit)
"traefik.HTTP.Middlewares.Middleware12.RateLimit.RateSet.Rate0.Average": "42", // "traefik.HTTP.Middlewares.Middleware12.RateLimit.ExtractorFunc": "foobar",
"traefik.HTTP.Middlewares.Middleware12.RateLimit.RateSet.Rate0.Burst": "42", // "traefik.HTTP.Middlewares.Middleware12.RateLimit.RateSet.Rate0.Average": "42",
"traefik.HTTP.Middlewares.Middleware12.RateLimit.RateSet.Rate0.Period": "42", // "traefik.HTTP.Middlewares.Middleware12.RateLimit.RateSet.Rate0.Burst": "42",
"traefik.HTTP.Middlewares.Middleware12.RateLimit.RateSet.Rate1.Average": "42", // "traefik.HTTP.Middlewares.Middleware12.RateLimit.RateSet.Rate0.Period": "42",
"traefik.HTTP.Middlewares.Middleware12.RateLimit.RateSet.Rate1.Burst": "42", // "traefik.HTTP.Middlewares.Middleware12.RateLimit.RateSet.Rate1.Average": "42",
"traefik.HTTP.Middlewares.Middleware12.RateLimit.RateSet.Rate1.Period": "42", // "traefik.HTTP.Middlewares.Middleware12.RateLimit.RateSet.Rate1.Burst": "42",
"traefik.HTTP.Middlewares.Middleware13.RedirectRegex.Regex": "foobar", // "traefik.HTTP.Middlewares.Middleware12.RateLimit.RateSet.Rate1.Period": "42",
"traefik.HTTP.Middlewares.Middleware13.RedirectRegex.Replacement": "foobar", "traefik.HTTP.Middlewares.Middleware13.RedirectRegex.Regex": "foobar",
"traefik.HTTP.Middlewares.Middleware13.RedirectRegex.Permanent": "true", "traefik.HTTP.Middlewares.Middleware13.RedirectRegex.Replacement": "foobar",
"traefik.HTTP.Middlewares.Middleware13b.RedirectScheme.Scheme": "https", "traefik.HTTP.Middlewares.Middleware13.RedirectRegex.Permanent": "true",
"traefik.HTTP.Middlewares.Middleware13b.RedirectScheme.Port": "80", "traefik.HTTP.Middlewares.Middleware13b.RedirectScheme.Scheme": "https",
"traefik.HTTP.Middlewares.Middleware13b.RedirectScheme.Permanent": "true", "traefik.HTTP.Middlewares.Middleware13b.RedirectScheme.Port": "80",
"traefik.HTTP.Middlewares.Middleware14.ReplacePath.Path": "foobar", "traefik.HTTP.Middlewares.Middleware13b.RedirectScheme.Permanent": "true",
"traefik.HTTP.Middlewares.Middleware15.ReplacePathRegex.Regex": "foobar", "traefik.HTTP.Middlewares.Middleware14.ReplacePath.Path": "foobar",
"traefik.HTTP.Middlewares.Middleware15.ReplacePathRegex.Replacement": "foobar", "traefik.HTTP.Middlewares.Middleware15.ReplacePathRegex.Regex": "foobar",
"traefik.HTTP.Middlewares.Middleware16.Retry.Attempts": "42", "traefik.HTTP.Middlewares.Middleware15.ReplacePathRegex.Replacement": "foobar",
"traefik.HTTP.Middlewares.Middleware17.StripPrefix.Prefixes": "foobar, fiibar", "traefik.HTTP.Middlewares.Middleware16.Retry.Attempts": "42",
"traefik.HTTP.Middlewares.Middleware18.StripPrefixRegex.Regex": "foobar, fiibar", "traefik.HTTP.Middlewares.Middleware17.StripPrefix.Prefixes": "foobar, fiibar",
"traefik.HTTP.Middlewares.Middleware19.Compress": "true", "traefik.HTTP.Middlewares.Middleware18.StripPrefixRegex.Regex": "foobar, fiibar",
"traefik.HTTP.Middlewares.Middleware19.Compress": "true",
"traefik.HTTP.Routers.Router0.EntryPoints": "foobar, fiibar", "traefik.HTTP.Routers.Router0.EntryPoints": "foobar, fiibar",
"traefik.HTTP.Routers.Router0.Middlewares": "foobar, fiibar", "traefik.HTTP.Routers.Router0.Middlewares": "foobar, fiibar",

View file

@ -20,7 +20,6 @@ import (
"github.com/containous/traefik/pkg/middlewares/ipwhitelist" "github.com/containous/traefik/pkg/middlewares/ipwhitelist"
"github.com/containous/traefik/pkg/middlewares/maxconnection" "github.com/containous/traefik/pkg/middlewares/maxconnection"
"github.com/containous/traefik/pkg/middlewares/passtlsclientcert" "github.com/containous/traefik/pkg/middlewares/passtlsclientcert"
"github.com/containous/traefik/pkg/middlewares/ratelimiter"
"github.com/containous/traefik/pkg/middlewares/redirect" "github.com/containous/traefik/pkg/middlewares/redirect"
"github.com/containous/traefik/pkg/middlewares/replacepath" "github.com/containous/traefik/pkg/middlewares/replacepath"
"github.com/containous/traefik/pkg/middlewares/replacepathregex" "github.com/containous/traefik/pkg/middlewares/replacepathregex"
@ -232,15 +231,16 @@ func (b *Builder) buildConstructor(ctx context.Context, middlewareName string) (
} }
} }
// TODO: disable temporarily (rateLimit)
// RateLimit // RateLimit
if config.RateLimit != nil { // if config.RateLimit != nil {
if middleware != nil { // if middleware != nil {
return nil, badConf // return nil, badConf
} // }
middleware = func(next http.Handler) (http.Handler, error) { // middleware = func(next http.Handler) (http.Handler, error) {
return ratelimiter.New(ctx, next, *config.RateLimit, middlewareName) // return ratelimiter.New(ctx, next, *config.RateLimit, middlewareName)
} // }
} // }
// RedirectRegex // RedirectRegex
if config.RedirectRegex != nil { if config.RedirectRegex != nil {