Commit a2c7c5b9 by Arve Knudsen Committed by GitHub

API: Fix short URLs (#28300)

* API: Fix short URLs

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
parent c9cc82ea
......@@ -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{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment