mirror of
https://github.com/minio/minio.git
synced 2025-01-26 06:03:17 -05:00
Fix: Handle regression caused by gorilla mux v1.7.0 (#7595)
gorilla/mux#383 broke the compatibility with the existing code. This PR handles that scenario.
This commit is contained in:
parent
091b9b661f
commit
781012517d
@ -17,6 +17,7 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
@ -45,7 +46,13 @@ func registerAPIRouter(router *mux.Router, encryptionEnabled bool) {
|
|||||||
apiRouter := router.PathPrefix("/").Subrouter()
|
apiRouter := router.PathPrefix("/").Subrouter()
|
||||||
var routers []*mux.Router
|
var routers []*mux.Router
|
||||||
for _, domainName := range globalDomainNames {
|
for _, domainName := range globalDomainNames {
|
||||||
routers = append(routers, apiRouter.Host("{bucket:.+}."+domainName).Subrouter())
|
var hostPort string
|
||||||
|
if globalMinioPort != "443" && globalMinioPort != "80" {
|
||||||
|
hostPort = net.JoinHostPort(domainName, globalMinioPort)
|
||||||
|
} else {
|
||||||
|
hostPort = domainName
|
||||||
|
}
|
||||||
|
routers = append(routers, apiRouter.Host("{bucket:.+}."+hostPort).Subrouter())
|
||||||
}
|
}
|
||||||
routers = append(routers, apiRouter.PathPrefix("/{bucket}").Subrouter())
|
routers = append(routers, apiRouter.PathPrefix("/{bucket}").Subrouter())
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user