Skip to content

Commit

Permalink
add trimspace for url which contains spaces (apache#513)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicktming committed Oct 30, 2022
1 parent d4ef9ab commit 2f98cd2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pixiu/pkg/filter/http/loadbalancer/loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ func (factory *FilterFactory) PrepareFilterChain(ctx *contexthttp.HttpContext, c
func (f *Filter) Decode(c *contexthttp.HttpContext) filter.FilterStatus {
allInstances := strings.Split(c.GetAPI().IntegrationRequest.HTTPBackendConfig.URL, ",")
idx := rand.Int31n(int32(len(allInstances)))
c.Api.IntegrationRequest.HTTPBackendConfig.URL = allInstances[idx]
c.Api.IntegrationRequest.HTTPBackendConfig.URL = strings.TrimSpace(allInstances[idx])
return filter.Continue
}

0 comments on commit 2f98cd2

Please sign in to comment.