Skip to content

Commit a8046a8

Browse files
committed
Avoid id header for unique()
1 parent 76fe396 commit a8046a8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

templates/go/client.go.twig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,14 @@ func (clt *Client) FileUpload(url string, headers map[string]interface{}, params
196196
return nil, err
197197
}
198198
params[paramName] = inputFile
199-
if uploadId != "" {
199+
if uploadId != "" && uploadId != "unique()" {
200200
headers["x-appwrite-id"] = uploadId
201201
}
202202
totalSize := fileInfo.Size()
203203
start := offset
204204
end := offset + clt.chunkSize - 1
205-
if end > totalSize {
206-
end = totalSize
205+
if end >= totalSize {
206+
end = totalSize - 1
207207
}
208208
headers["content-range"] = fmt.Sprintf("bytes %d-%d/%d", start, end, totalSize)
209209
result, err = clt.Call("POST", url, headers, params)

0 commit comments

Comments
 (0)