[bugfix] Fix CLI drops controller URL path when querying logs (#1201)
This commit is contained in:
@@ -21,6 +21,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"path"
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -144,8 +145,8 @@ func (influx InfluxDB) query(query influxdbClient.Query) (*influxdbClient.Respon
|
|||||||
}
|
}
|
||||||
// connect to controller first, then controller will redirect our query command
|
// connect to controller first, then controller will redirect our query command
|
||||||
// to influxdb and proxy back the db response.
|
// to influxdb and proxy back the db response.
|
||||||
queryURL.Path = fmt.Sprintf("/proxy/%s", INFLUXDB)
|
queryURL.Path = path.Clean(fmt.Sprintf("%s/proxy/%s", queryURL.Path, INFLUXDB))
|
||||||
req, err := http.NewRequest("POST", queryURL.String(), nil)
|
req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user