aboutsummaryrefslogtreecommitdiff
path: root/weed/s3api/s3api_object_handlers_postpolicy.go
diff options
context:
space:
mode:
authorEng Zer Jun <engzerjun@gmail.com>2021-10-14 12:27:58 +0800
committerEng Zer Jun <engzerjun@gmail.com>2021-10-14 12:27:58 +0800
commita23bcbb7ecf93fcda35976f4f2fb42a67830e718 (patch)
tree3227e82e51346dad8649a17e991c9cf561ef8071 /weed/s3api/s3api_object_handlers_postpolicy.go
parent4cbd390fbe634e2370c36a61b1574e9d648c3cee (diff)
downloadseaweedfs-a23bcbb7ecf93fcda35976f4f2fb42a67830e718.tar.xz
seaweedfs-a23bcbb7ecf93fcda35976f4f2fb42a67830e718.zip
refactor: move from io/ioutil to io and os package
The io/ioutil package has been deprecated as of Go 1.16, see https://golang.org/doc/go1.16#ioutil. This commit replaces the existing io/ioutil functions with their new definitions in io and os packages. Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Diffstat (limited to 'weed/s3api/s3api_object_handlers_postpolicy.go')
-rw-r--r--weed/s3api/s3api_object_handlers_postpolicy.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/weed/s3api/s3api_object_handlers_postpolicy.go b/weed/s3api/s3api_object_handlers_postpolicy.go
index c0e2589ae..cccbd2442 100644
--- a/weed/s3api/s3api_object_handlers_postpolicy.go
+++ b/weed/s3api/s3api_object_handlers_postpolicy.go
@@ -5,17 +5,17 @@ import (
"encoding/base64"
"errors"
"fmt"
- "github.com/chrislusf/seaweedfs/weed/glog"
- "github.com/chrislusf/seaweedfs/weed/s3api/policy"
- "github.com/chrislusf/seaweedfs/weed/s3api/s3err"
- "github.com/dustin/go-humanize"
- "github.com/gorilla/mux"
"io"
- "io/ioutil"
"mime/multipart"
"net/http"
"net/url"
"strings"
+
+ "github.com/chrislusf/seaweedfs/weed/glog"
+ "github.com/chrislusf/seaweedfs/weed/s3api/policy"
+ "github.com/chrislusf/seaweedfs/weed/s3api/s3err"
+ "github.com/dustin/go-humanize"
+ "github.com/gorilla/mux"
)
func (s3a *S3ApiServer) PostPolicyBucketHandler(w http.ResponseWriter, r *http.Request) {
@@ -152,7 +152,7 @@ func (s3a *S3ApiServer) PostPolicyBucketHandler(w http.ResponseWriter, r *http.R
// Extract form fields and file data from a HTTP POST Policy
func extractPostPolicyFormValues(form *multipart.Form) (filePart io.ReadCloser, fileName string, fileSize int64, formValues http.Header, err error) {
- /// HTML Form values
+ // / HTML Form values
fileName = ""
// Canonicalize the form values into http.Header.
@@ -175,7 +175,7 @@ func extractPostPolicyFormValues(form *multipart.Form) (filePart io.ReadCloser,
b.WriteString(v)
}
fileSize = int64(b.Len())
- filePart = ioutil.NopCloser(b)
+ filePart = io.NopCloser(b)
return filePart, fileName, fileSize, formValues, nil
}