mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Render: Use https as protocol when rendering if HTTP2 enabled (#21600)
This fixes so that protocol is https instead of h2 when rendering image if Grafana is configured to use HTTP2. Ref grafana/grafana-image-renderer#77
This commit is contained in:
parent
b087edc224
commit
d2b08c8368
@ -135,8 +135,17 @@ func (rs *RenderingService) getURL(path string) string {
|
||||
return fmt.Sprintf("%s%s&render=1", rs.Cfg.RendererCallbackUrl, path)
|
||||
|
||||
}
|
||||
|
||||
protocol := setting.Protocol
|
||||
switch setting.Protocol {
|
||||
case setting.HTTP:
|
||||
protocol = "http"
|
||||
case setting.HTTP2, setting.HTTPS:
|
||||
protocol = "https"
|
||||
}
|
||||
|
||||
// &render=1 signals to the legacy redirect layer to
|
||||
return fmt.Sprintf("%s://%s:%s/%s&render=1", setting.Protocol, rs.domain, setting.HttpPort, path)
|
||||
return fmt.Sprintf("%s://%s:%s/%s&render=1", protocol, rs.domain, setting.HttpPort, path)
|
||||
}
|
||||
|
||||
func (rs *RenderingService) getRenderKey(orgId, userId int64, orgRole models.RoleType) (string, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user