diff options
Diffstat (limited to 'weed/operation')
| -rw-r--r-- | weed/operation/chunked_file.go | 2 | ||||
| -rw-r--r-- | weed/operation/upload_content.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/weed/operation/chunked_file.go b/weed/operation/chunked_file.go index c451420fe..02faf9904 100644 --- a/weed/operation/chunked_file.go +++ b/weed/operation/chunked_file.go @@ -95,7 +95,7 @@ func (cm *ChunkManifest) DeleteChunks(masterFn GetMasterFn, usePublicUrl bool, g } func readChunkNeedle(fileUrl string, w io.Writer, offset int64, jwt string) (written int64, e error) { - req, err := http.NewRequest("GET", fileUrl, nil) + req, err := http.NewRequest(http.MethodGet, fileUrl, nil) if err != nil { return written, err } diff --git a/weed/operation/upload_content.go b/weed/operation/upload_content.go index a1df07d7e..6c6aec1b5 100644 --- a/weed/operation/upload_content.go +++ b/weed/operation/upload_content.go @@ -325,7 +325,7 @@ func upload_content(fillBufferFunction func(w io.Writer) error, originalDataSize } else { reqReader = bytes.NewReader(option.BytesBuffer.Bytes()) } - req, postErr := http.NewRequest("POST", option.UploadUrl, reqReader) + req, postErr := http.NewRequest(http.MethodPost, option.UploadUrl, reqReader) if postErr != nil { glog.V(1).Infof("create upload request %s: %v", option.UploadUrl, postErr) return nil, fmt.Errorf("create upload request %s: %v", option.UploadUrl, postErr) |
