Image Renderer: Minor refactor cleanup (#100089)

This commit is contained in:
Nathan Marrs 2025-02-06 08:01:11 -07:00 committed by GitHub
parent 4c52abb6b4
commit 21bfdd445f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -424,7 +424,7 @@ func (rs *RenderingService) getNewFilePath(rt RenderType) (string, error) {
// getGrafanaCallbackURL creates a URL to send to the image rendering as callback for rendering a Grafana resource
func (rs *RenderingService) getGrafanaCallbackURL(path string) string {
if rs.Cfg.RendererUrl != "" {
if rs.Cfg.RendererUrl != "" || rs.Cfg.RendererCallbackUrl != "" {
// The backend rendering service can potentially be remote.
// So we need to use the root_url to ensure the rendering service
// can reach this Grafana instance.
@ -433,11 +433,6 @@ func (rs *RenderingService) getGrafanaCallbackURL(path string) string {
return fmt.Sprintf("%s%s&render=1", rs.Cfg.RendererCallbackUrl, path)
}
if rs.Cfg.RendererCallbackUrl != "" {
// &render=1 signals to the legacy redirect layer to
return fmt.Sprintf("%s%s&render=1", rs.Cfg.RendererCallbackUrl, path)
}
protocol := rs.Cfg.Protocol
switch protocol {
case setting.HTTPScheme: