client rebuilding in progress
This commit is contained in:
@@ -21,14 +21,14 @@ func (cli *Client) PutFile(ctx context.Context, rawpath string, src io.Reader, s
|
||||
}
|
||||
req.Header.Set("User-Agent", cli.userAgent)
|
||||
req.Header.Set("Content-Type", "application/octet-stream")
|
||||
req.Header.Set("Content-Length", strconv.FormatInt(size, 10))
|
||||
req.Header.Set("Content-Size", strconv.FormatInt(size, 10))
|
||||
resp, err := cli.httpClient.Do(req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
resp.Body.Close()
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
err = fmt.Errorf("File not accepted, code %d", resp.StatusCode)
|
||||
err = fmt.Errorf("File not accepted, code %s", resp.Status)
|
||||
return err
|
||||
}
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user