Move middleware context handler logic to service (#29605)
* middleware: Move context handler to own service Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> Co-authored-by: Emil Tullsted <sakjur@users.noreply.github.com> Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
This commit is contained in:
co-authored by
Emil Tullsted
Will Browne
parent
d0f52d5334
commit
12661e8a9d
@@ -25,12 +25,13 @@ import (
|
||||
func init() {
|
||||
remotecache.Register(&RenderUser{})
|
||||
registry.Register(®istry.Descriptor{
|
||||
Name: "RenderingService",
|
||||
Name: ServiceName,
|
||||
Instance: &RenderingService{},
|
||||
InitPriority: registry.High,
|
||||
})
|
||||
}
|
||||
|
||||
const ServiceName = "RenderingService"
|
||||
const renderKeyPrefix = "render-%s"
|
||||
|
||||
type RenderUser struct {
|
||||
@@ -226,8 +227,8 @@ func (rs *RenderingService) getURL(path string) string {
|
||||
return fmt.Sprintf("%s%s&render=1", rs.Cfg.RendererCallbackUrl, path)
|
||||
}
|
||||
|
||||
protocol := setting.Protocol
|
||||
switch setting.Protocol {
|
||||
protocol := rs.Cfg.Protocol
|
||||
switch protocol {
|
||||
case setting.HTTPScheme:
|
||||
protocol = "http"
|
||||
case setting.HTTP2Scheme, setting.HTTPSScheme:
|
||||
|
||||
Reference in New Issue
Block a user