mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
Fix: Handle regression caused by gorilla mux v1.7.0 (#7625)
PR #7595 fixed part of the regression, but did not handle the scenario, where in docker, the internal port is different from the port on the host. This PR modifies the regular expression such that all the scenarios are handled. Fixes #7619
This commit is contained in:
parent
08b9244c48
commit
c422f7f412
@ -17,7 +17,6 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"net"
|
||||
"net/http"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
@ -46,13 +45,8 @@ func registerAPIRouter(router *mux.Router, encryptionEnabled bool) {
|
||||
apiRouter := router.PathPrefix("/").Subrouter()
|
||||
var routers []*mux.Router
|
||||
for _, domainName := range globalDomainNames {
|
||||
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.Host("{bucket:.+}."+domainName).Subrouter())
|
||||
routers = append(routers, apiRouter.Host("{bucket:.+}."+domainName+":{port:.*}").Subrouter())
|
||||
}
|
||||
routers = append(routers, apiRouter.PathPrefix("/{bucket}").Subrouter())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user