mirror of
https://github.com/prymitive/karma
synced 2026-05-05 03:16:51 +00:00
fix(proxy): check for trailing slash on listen.prefix when proxy is on
When constructing proxy path to listen on for requests to pass upstream check if listen.prefix ends with / and if no inject it. Fixes #386
This commit is contained in:
6
proxy.go
6
proxy.go
@@ -15,7 +15,11 @@ import (
|
||||
)
|
||||
|
||||
func proxyPathPrefix(name string) string {
|
||||
return fmt.Sprintf("%sproxy/alertmanager/%s", config.Config.Listen.Prefix, name)
|
||||
maybeSlash := ""
|
||||
if !strings.HasSuffix(config.Config.Listen.Prefix, "/") {
|
||||
maybeSlash = "/"
|
||||
}
|
||||
return fmt.Sprintf("%s%sproxy/alertmanager/%s", config.Config.Listen.Prefix, maybeSlash, name)
|
||||
}
|
||||
|
||||
func proxyPath(name, path string) string {
|
||||
|
||||
Reference in New Issue
Block a user