diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-11-11 12:56:53 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-11-11 12:56:53 -0800 |
| commit | a29abd8600208572acf15915758794c01ba21449 (patch) | |
| tree | a9c253e140bd4292a62488e2b4d1fb2748ad62ce | |
| parent | 8708e7a64d19d330311aee16d26ae2f4272d3c1e (diff) | |
| download | seaweedfs-a29abd8600208572acf15915758794c01ba21449.tar.xz seaweedfs-a29abd8600208572acf15915758794c01ba21449.zip | |
add a {X-,}Idempotency-Key header for http POST
fix https://github.com/chrislusf/seaweedfs/issues/1592
according to https://github.com/golang/go/issues/19943
| -rw-r--r-- | weed/operation/upload_content.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/weed/operation/upload_content.go b/weed/operation/upload_content.go index 5fe99ba5b..fccc24b16 100644 --- a/weed/operation/upload_content.go +++ b/weed/operation/upload_content.go @@ -190,6 +190,7 @@ func upload_content(uploadUrl string, fillBufferFunction func(w io.Writer) error body_writer := multipart.NewWriter(buf) h := make(textproto.MIMEHeader) h.Set("Content-Disposition", fmt.Sprintf(`form-data; name="file"; filename="%s"`, fileNameEscaper.Replace(filename))) + h.Set("Idempotency-Key", uploadUrl) if mtype == "" { mtype = mime.TypeByExtension(strings.ToLower(filepath.Ext(filename))) } |
