MSP-2684 Update Entrypoint function
This commit is contained in:
1 parent
87690bbd12
commit
1f40e9d5d3
2 files changed
+5
-9
No files matched your search
+2
-6
@@ -71,7 +71,6 @@ func (l Locator) Handler(config conf.Remote, locations []conf.Location, redisCli
|
||||
|
||||
mux := mux2.NewRouter()
|
||||
for _, location := range locations {
|
||||
location := location
|
||||
var proxyFunc middleware.Handler
|
||||
enableBodyLog := config.Logging.BodyLogEnable
|
||||
|
||||
@@ -112,15 +111,12 @@ func (l Locator) Handler(config conf.Remote, locations []conf.Location, redisCli
|
||||
middleware.ErrorHandler(l.logger),
|
||||
)
|
||||
}
|
||||
var prefixToTrim *string
|
||||
if !location.WithPrefix {
|
||||
prefixToTrim = &location.PathPrefix
|
||||
}
|
||||
entrypoint := middleware.Entrypoint(
|
||||
config.Http.MaxRequestBodySizeInMb*1024*1024, //nolint:gomnd
|
||||
handler,
|
||||
l.logger,
|
||||
prefixToTrim,
|
||||
location.PathPrefix,
|
||||
location.WithPrefix,
|
||||
)
|
||||
mux.PathPrefix(location.PathPrefix).Handler(entrypoint)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user