Skip to content

Commit e7560d6

Browse files
committed
fix: Corrected resumable upload response
1 parent 462e5b6 commit e7560d6

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

internal/types/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ type UploadResponse struct {
1212
GroupId *string `json:"group_id"`
1313
KeyValues map[string]string `json:"keyvalues"`
1414
Vectorized bool `json:"vectorized"`
15-
Network string `json:"network"`
15+
Network string `json:"network,omitempty"`
1616
IsDuplicate bool `json:"is_duplicate,omitempty"`
1717
} `json:"data"`
1818
}

internal/upload/uploads.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ func uploadWithTUS(filePath string, groupId string, name string, verbose bool, s
279279
urlParts := strings.Split(uploadURL, "/")
280280
fileId := urlParts[len(urlParts)-2]
281281

282-
apiURL := fmt.Sprintf("https://%s/v3/files/%s", cliConfig.GetAPIHost(), fileId)
282+
apiURL := fmt.Sprintf("https://%s/v3/files/%s/%s", cliConfig.GetAPIHost(), networkParam, fileId)
283283
req, err := http.NewRequest("GET", apiURL, nil)
284284
if err != nil {
285285
return types.UploadResponse{}, fmt.Errorf("failed to create response request: %w", err)
@@ -396,7 +396,7 @@ func folderUpload(filePath string, groupId string, name string, verbose bool) (t
396396
GroupId *string `json:"group_id"`
397397
KeyValues map[string]string `json:"keyvalues"`
398398
Vectorized bool `json:"vectorized"`
399-
Network string `json:"network"`
399+
Network string `json:"network,omitempty"`
400400
IsDuplicate bool `json:"is_duplicate,omitempty"`
401401
}{
402402
Id: pinningResponse.ID,

0 commit comments

Comments
 (0)