mirror of
https://github.com/minio/minio.git
synced 2025-11-21 02:09:08 -05:00
fix: add virtual host style workaround for gorilla/mux issue (#10010)
gorilla/mux broke their recent release 1.7.4 which we upgraded to, we need the current workaround to ensure that our regex matches appropriately. An upstream PR is sent, we should remove the workaround once we have a new release.
This commit is contained in:
@@ -84,7 +84,15 @@ func registerAPIRouter(router *mux.Router, encryptionEnabled, allowSSEKMS bool)
|
||||
apiRouter := router.PathPrefix(SlashSeparator).Subrouter()
|
||||
var routers []*mux.Router
|
||||
for _, domainName := range globalDomainNames {
|
||||
routers = append(routers, apiRouter.Host("{bucket:.+}."+domainName).Subrouter())
|
||||
if globalMinioPort == "80" || globalMinioPort == "443" {
|
||||
// For standard ports its possible, incoming requests
|
||||
// might not have a port assigned, in such scenarios use
|
||||
// have wildcard routing.
|
||||
// FIXME: remove this code once https://github.com/gorilla/mux/pull/579
|
||||
// is merged and released upstream, as this entire change can become
|
||||
// a single line.
|
||||
routers = append(routers, apiRouter.Host("{bucket:.+}."+domainName).Subrouter())
|
||||
}
|
||||
routers = append(routers, apiRouter.Host("{bucket:.+}."+domainName+":{port:.*}").Subrouter())
|
||||
}
|
||||
routers = append(routers, apiRouter.PathPrefix("/{bucket}").Subrouter())
|
||||
|
||||
Reference in New Issue
Block a user