mirror of
https://github.com/grafana/grafana.git
synced 2025-02-10 23:55:47 -06:00
API: Fix short URLs (#28300)
* API: Fix short URLs Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
parent
c9cc82ea55
commit
a2c7c5b912
@ -2,6 +2,7 @@ package api
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"path"
|
||||
"strings"
|
||||
|
||||
@ -27,7 +28,7 @@ func (hs *HTTPServer) createShortURL(c *models.ReqContext, cmd dtos.CreateShortU
|
||||
return Error(500, "Failed to create short URL", err)
|
||||
}
|
||||
|
||||
url := path.Join(setting.AppUrl, "goto", shortURL.Uid)
|
||||
url := fmt.Sprintf("%s/goto/%s", strings.TrimSuffix(setting.AppUrl, "/"), shortURL.Uid)
|
||||
c.Logger.Debug("Created short URL", "url", url)
|
||||
|
||||
dto := dtos.ShortURL{
|
||||
|
Loading…
Reference in New Issue
Block a user