File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,12 @@ const (
4848 // Google Cloud Storage endpoint
4949 gcsEndpoint = "storage.googleapis.com"
5050
51+ // CoreWeave Object Storage endpoint
52+ cwObjectEndpoint = "cwobject.com"
53+
54+ // CoreWeave Object Storage LOTA endpoint
55+ cwLotaEndpoint = "cwlota.com"
56+
5157 // the key of the object metadata which is used to handle retry decision on NoSuchUpload error
5258 metadataKeyRetryID = "s5cmd-upload-retry-id"
5359)
@@ -1422,11 +1428,15 @@ func IsGoogleEndpoint(endpoint urlpkg.URL) bool {
14221428 return endpoint .Hostname () == gcsEndpoint
14231429}
14241430
1431+ func IsCoreWeaveEndpoint (endpoint urlpkg.URL ) bool {
1432+ return endpoint .Hostname () == cwObjectEndpoint || endpoint .Hostname () == cwLotaEndpoint
1433+ }
1434+
14251435// isVirtualHostStyle reports whether the given endpoint supports S3 virtual
14261436// host style bucket name resolving. If a custom S3 API compatible endpoint is
14271437// given, resolve the bucketname from the URL path.
14281438func isVirtualHostStyle (endpoint urlpkg.URL ) bool {
1429- return endpoint == sentinelURL || supportsTransferAcceleration (endpoint ) || IsGoogleEndpoint (endpoint )
1439+ return endpoint == sentinelURL || supportsTransferAcceleration (endpoint ) || IsGoogleEndpoint (endpoint ) || IsCoreWeaveEndpoint ( endpoint )
14301440}
14311441
14321442func errHasCode (err error , code string ) bool {
Original file line number Diff line number Diff line change @@ -61,6 +61,16 @@ func TestNewSessionPathStyle(t *testing.T) {
6161 endpoint : urlpkg.URL {Scheme : "https" , Host : gcsEndpoint },
6262 expectPathStyle : false ,
6363 },
64+ {
65+ name : "expect_virtual_host_style_for_coreweave_object_storage" ,
66+ endpoint : urlpkg.URL {Scheme : "https" , Host : cwObjectEndpoint },
67+ expectPathStyle : false ,
68+ },
69+ {
70+ name : "expect_virtual_host_style_for_coreweave_object_storage_lota" ,
71+ endpoint : urlpkg.URL {Scheme : "http" , Host : cwLotaEndpoint },
72+ expectPathStyle : false ,
73+ },
6474 {
6575 name : "expect_path_style_for_localhost" ,
6676 endpoint : urlpkg.URL {Scheme : "http" , Host : "127.0.0.1" },
You can’t perform that action at this time.
0 commit comments