MSP-2684 Add using 'withPrefix' flag to avoid trimming request's url prefix
This commit is contained in:
1 parent
402c6c18cf
commit
8a83ba0b3a
2 files changed
+11
-5
No files matched your search
+5
-2
@@ -111,12 +111,15 @@ 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,
|
||||
location.PathPrefix,
|
||||
l.logger,
|
||||
prefixToTrim,
|
||||
)
|
||||
mux.PathPrefix(location.PathPrefix).Handler(entrypoint)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user