Skip to content
Snippets Groups Projects
Unverified Commit 9c40c29c authored by Patrick Jiang(白泽)'s avatar Patrick Jiang(白泽) Committed by GitHub
Browse files

Merge pull request #1003 from fangyincheng/trim-filter

Imp: add trim for filter name list in config file
parents 016bcce8 31118543
No related branches found
No related tags found
No related merge requests found
......@@ -77,8 +77,8 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
github.com/alibaba/sentinel-golang v1.0.1 h1:WlhN0XUxRyfkiDc8TO6CcRrnakwFP9zFtvJTYxZRCgI=
github.com/alibaba/sentinel-golang v1.0.1/go.mod h1:QsB99f/z35D2AiMrAWwgWE85kDTkBUIkcmPrRt+61NI=
github.com/alibaba/sentinel-golang v1.0.2 h1:Acopq74hOtZN4MV1v811MQ6QcqPFLDSczTrRXv9zpIg=
github.com/alibaba/sentinel-golang v1.0.2/go.mod h1:QsB99f/z35D2AiMrAWwgWE85kDTkBUIkcmPrRt+61NI=
github.com/aliyun/alibaba-cloud-sdk-go v1.61.18 h1:zOVTBdCKFd9JbCKz9/nt+FovbjPFmb7mUnp8nH9fQBA=
github.com/aliyun/alibaba-cloud-sdk-go v1.61.18/go.mod h1:v8ESoHo4SyHmuB4b1tJqDHxfTGEciD+yhvOU/5s1Rfk=
github.com/apache/dubbo-getty v1.4.1 h1:M9yaFhemThQSWtRwmJNrxNuv7FzydlFx5EY8oq1v+lw=
......@@ -747,6 +747,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/tebeka/strftime v0.1.3 h1:5HQXOqWKYRFfNyBMNVc9z5+QzuBtIXy03psIhtdJYto=
......
......@@ -77,7 +77,7 @@ func buildInvokerChain(invoker protocol.Invoker, key string) protocol.Invoker {
// The order of filters is from left to right, so loading from right to left
next := invoker
for i := len(filterNames) - 1; i >= 0; i-- {
flt := extension.GetFilter(filterNames[i])
flt := extension.GetFilter(strings.TrimSpace(filterNames[i]))
fi := &FilterInvoker{next: next, invoker: invoker, filter: flt}
next = fi
}
......
......@@ -42,7 +42,7 @@ func TestProtocolFilterWrapperExport(t *testing.T) {
u := common.NewURLWithOptions(
common.WithParams(url.Values{}),
common.WithParamsValue(constant.SERVICE_FILTER_KEY, "echo"))
common.WithParamsValue(constant.SERVICE_FILTER_KEY, "echo "))
exporter := filtProto.Export(protocol.NewBaseInvoker(u))
_, ok := exporter.GetInvoker().(*FilterInvoker)
assert.True(t, ok)
......@@ -54,7 +54,7 @@ func TestProtocolFilterWrapperRefer(t *testing.T) {
u := common.NewURLWithOptions(
common.WithParams(url.Values{}),
common.WithParamsValue(constant.REFERENCE_FILTER_KEY, "echo"))
common.WithParamsValue(constant.REFERENCE_FILTER_KEY, " echo"))
invoker := filtProto.Refer(u)
_, ok := invoker.(*FilterInvoker)
assert.True(t, ok)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment