nicktming opened a new issue, #512:
URL: https://github.com/apache/dubbo-go-pixiu/issues/512

   <!-- Please only use this template for submitting enhancement requests -->
   
   api-config.yaml 
   ```
   name: pixiu
   description: pixiu sample
   resources:
     - path: 'xxx'
       ...
       methods:
         - httpVerb: POST
           ...
           integrationRequest:
             ...
             url: "x.x.x.1:20005, x.x.x.2:20005"
   
   ```
   
   **What would you like to be added**:
   
   problem: 
   - it works well if url is 'x.x.x.1:20005,x.x.x.2:20005'
   - it does not work well if url is 'x.x.x.1:20005, x.x.x.2:20005', since it 
will get a url named ' x.x.x.2:20005' , and expected url is 'x.x.x.2:20005' 
which does not have a space;
   
   code comes from /pixiu/pkg/filter/http/loadbalancer/loadbalancer.go  
   ```
   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]
        return filter.Continue
   }
   ```
   
   it could be enhanced as follows:
   ```
   c.Api.IntegrationRequest.HTTPBackendConfig.URL = 
strings.TrimSpace(allInstances[idx])
   ```
   
   **Why is this needed**:
   
   easy to use
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to