Image Rendering: Make it work using serve_from_sub_path configured (#23706)

Make rendering work when using serve_from_sub_path and not have rendering.renderer_url configured.

Fixes #21925
This commit is contained in:
Marcus Efraimsson
2020-04-21 19:57:11 +02:00
committed by GitHub
parent ea1dd9e4da
commit 61de19250d
2 changed files with 65 additions and 1 deletions
+6 -1
View File
@@ -186,8 +186,13 @@ func (rs *RenderingService) getURL(path string) string {
protocol = "https"
}
subPath := ""
if rs.Cfg.ServeFromSubPath {
subPath = rs.Cfg.AppSubUrl
}
// &render=1 signals to the legacy redirect layer to
return fmt.Sprintf("%s://%s:%s/%s&render=1", protocol, rs.domain, setting.HttpPort, path)
return fmt.Sprintf("%s://%s:%s%s/%s&render=1", protocol, rs.domain, setting.HttpPort, subPath, path)
}
func (rs *RenderingService) generateAndStoreRenderKey(orgId, userId int64, orgRole models.RoleType) (string, error) {