diff options
Diffstat (limited to 'weed/filesys')
| -rw-r--r-- | weed/filesys/wfs_filer_client.go | 7 | ||||
| -rw-r--r-- | weed/filesys/wfs_write.go | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/weed/filesys/wfs_filer_client.go b/weed/filesys/wfs_filer_client.go index e0d352a7b..ef4213af1 100644 --- a/weed/filesys/wfs_filer_client.go +++ b/weed/filesys/wfs_filer_client.go @@ -25,3 +25,10 @@ func (wfs *WFS) WithFilerClient(fn func(filer_pb.SeaweedFilerClient) error) erro return err } + +func (wfs *WFS) AdjustedUrl(location *filer_pb.Location) string { + if wfs.option.OutsideContainerClusterMode { + return location.PublicUrl + } + return location.Url +} diff --git a/weed/filesys/wfs_write.go b/weed/filesys/wfs_write.go index dfe6e57a6..54e114013 100644 --- a/weed/filesys/wfs_write.go +++ b/weed/filesys/wfs_write.go @@ -44,7 +44,7 @@ func (wfs *WFS) saveDataAsChunk(fullPath util.FullPath) filer.SaveDataAsChunkFun Url: resp.Url, PublicUrl: resp.PublicUrl, } - host = loc.Url + host = wfs.AdjustedUrl(loc) collection, replication = resp.Collection, resp.Replication return nil |
