Add multiple rules
Signed-off-by: Emile Vauge <emile@vauge.com>
This commit is contained in:
parent
ef72d355d6
commit
8486766a60
3 changed files with 78 additions and 31 deletions
10
server.go
10
server.go
|
@ -57,8 +57,8 @@ type serverEntryPoint struct {
|
|||
}
|
||||
|
||||
type serverRoute struct {
|
||||
route *mux.Route
|
||||
stripPrefix string
|
||||
route *mux.Route
|
||||
stripPrefixes []string
|
||||
}
|
||||
|
||||
// NewServer returns an initialized Server.
|
||||
|
@ -471,10 +471,10 @@ func (server *Server) loadConfig(configurations configs, globalConfiguration Glo
|
|||
|
||||
func (server *Server) wireFrontendBackend(serverRoute *serverRoute, handler http.Handler) {
|
||||
// strip prefix
|
||||
if len(serverRoute.stripPrefix) > 0 {
|
||||
if len(serverRoute.stripPrefixes) > 0 {
|
||||
serverRoute.route.Handler(&middlewares.StripPrefix{
|
||||
Prefix: serverRoute.stripPrefix,
|
||||
Handler: handler,
|
||||
Prefixes: serverRoute.stripPrefixes,
|
||||
Handler: handler,
|
||||
})
|
||||
} else {
|
||||
serverRoute.route.Handler(handler)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue