Short URL: Fix so that orgId is included in generated short URL (#34696)

Fixes #33813

Signed-off-by: Jan Jansen <jan.jansen@gdata.de>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
This commit is contained in:
Jan Jansen
2021-06-01 14:19:10 +02:00
committed by GitHub
co-authored by Marcus Efraimsson
parent ff03b456f1
commit 0d1b35f99e
3 changed files with 70 additions and 2 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ func (hs *HTTPServer) createShortURL(c *models.ReqContext, cmd dtos.CreateShortU
return response.Error(500, "Failed to create short URL", err)
}
url := fmt.Sprintf("%s/goto/%s", strings.TrimSuffix(setting.AppUrl, "/"), shortURL.Uid)
url := fmt.Sprintf("%s/goto/%s?orgId=%d", strings.TrimSuffix(setting.AppUrl, "/"), shortURL.Uid, c.OrgId)
c.Logger.Debug("Created short URL", "url", url)
dto := dtos.ShortURL{