mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix(dataproxy): no trailing slash if proxypath is empty
The JoinUrlFragments function adds a trailing slash if to the proxy url if the proxy path is an empty string. This fix removes that trailing slash. Fixes #3847
This commit is contained in:
@@ -27,6 +27,11 @@ func (r *UrlQueryReader) Get(name string, def string) string {
|
||||
func JoinUrlFragments(a, b string) string {
|
||||
aslash := strings.HasSuffix(a, "/")
|
||||
bslash := strings.HasPrefix(b, "/")
|
||||
|
||||
if len(b) == 0 {
|
||||
return a
|
||||
}
|
||||
|
||||
switch {
|
||||
case aslash && bslash:
|
||||
return a + b[1:]
|
||||
|
||||
Reference in New Issue
Block a user