diff options
| author | hilimd <68371223+hilimd@users.noreply.github.com> | 2020-07-30 09:46:44 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-30 09:46:44 +0800 |
| commit | 4a88cca543cb487e04c13703d263c3f19f4c1e92 (patch) | |
| tree | e0b7f3b3e5728fe0d11503e4580987a026d161d9 /weed/s3api/s3api_server.go | |
| parent | 92c32f9d46c6cf817ca447b20c4919dfd7978624 (diff) | |
| parent | 5080bc1d6964cc71044333edc7ee36c1c1f06adb (diff) | |
| download | seaweedfs-4a88cca543cb487e04c13703d263c3f19f4c1e92.tar.xz seaweedfs-4a88cca543cb487e04c13703d263c3f19f4c1e92.zip | |
Merge pull request #6 from chrislusf/master
sync
Diffstat (limited to 'weed/s3api/s3api_server.go')
| -rw-r--r-- | weed/s3api/s3api_server.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/weed/s3api/s3api_server.go b/weed/s3api/s3api_server.go index 773094a5f..010958245 100644 --- a/weed/s3api/s3api_server.go +++ b/weed/s3api/s3api_server.go @@ -1,6 +1,7 @@ package s3api import ( + "fmt" "net/http" "github.com/gorilla/mux" @@ -9,6 +10,7 @@ import ( type S3ApiServerOption struct { Filer string + Port int FilerGrpcAddress string Config string DomainName string @@ -37,7 +39,10 @@ func (s3a *S3ApiServer) registerRouter(router *mux.Router) { apiRouter := router.PathPrefix("/").Subrouter() var routers []*mux.Router if s3a.option.DomainName != "" { - routers = append(routers, apiRouter.Host("{bucket:.+}."+s3a.option.DomainName).Subrouter()) + routers = append(routers, apiRouter.Host( + fmt.Sprintf("%s.%s:%d", "{bucket:.+}", s3a.option.DomainName, s3a.option.Port)).Subrouter()) + routers = append(routers, apiRouter.Host( + fmt.Sprintf("%s.%s", "{bucket:.+}", s3a.option.DomainName)).Subrouter()) } routers = append(routers, apiRouter.PathPrefix("/{bucket}").Subrouter()) |
