mirror of
https://github.com/minio/minio.git
synced 2025-11-30 05:41:00 -05:00
Use const slashSeparator instead of "/" everywhere (#8028)
This commit is contained in:
@@ -52,9 +52,15 @@ type Client struct {
|
||||
newAuthToken func() string
|
||||
}
|
||||
|
||||
// URL query separator constants
|
||||
const (
|
||||
resourceSep = "/"
|
||||
querySep = "?"
|
||||
)
|
||||
|
||||
// CallWithContext - make a REST call with context.
|
||||
func (c *Client) CallWithContext(ctx context.Context, method string, values url.Values, body io.Reader, length int64) (reply io.ReadCloser, err error) {
|
||||
req, err := http.NewRequest(http.MethodPost, c.url.String()+"/"+method+"?"+values.Encode(), body)
|
||||
req, err := http.NewRequest(http.MethodPost, c.url.String()+resourceSep+method+querySep+values.Encode(), body)
|
||||
if err != nil {
|
||||
return nil, &NetworkError{err}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user