mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Fix errinfo (#3893)
* types packages is imported more than onece * Fix error response when format of --expires is wrong. It MUST be in RFC 1123 date format.
This commit is contained in:
parent
d5364218b2
commit
97edb40275
|
@ -6,16 +6,17 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"encoding/xml"
|
"encoding/xml"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
|
|
||||||
"github.com/seaweedfs/seaweedfs/weed/security"
|
|
||||||
"github.com/seaweedfs/seaweedfs/weed/util/mem"
|
|
||||||
"golang.org/x/exp/slices"
|
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
|
||||||
|
"github.com/seaweedfs/seaweedfs/weed/security"
|
||||||
|
"github.com/seaweedfs/seaweedfs/weed/util/mem"
|
||||||
|
"golang.org/x/exp/slices"
|
||||||
|
|
||||||
"github.com/pquerna/cachecontrol/cacheobject"
|
"github.com/pquerna/cachecontrol/cacheobject"
|
||||||
"github.com/seaweedfs/seaweedfs/weed/filer"
|
"github.com/seaweedfs/seaweedfs/weed/filer"
|
||||||
|
|
||||||
|
@ -63,7 +64,7 @@ func (s3a *S3ApiServer) PutObjectHandler(w http.ResponseWriter, r *http.Request)
|
||||||
|
|
||||||
if r.Header.Get("Expires") != "" {
|
if r.Header.Get("Expires") != "" {
|
||||||
if _, err = time.Parse(http.TimeFormat, r.Header.Get("Expires")); err != nil {
|
if _, err = time.Parse(http.TimeFormat, r.Header.Get("Expires")); err != nil {
|
||||||
s3err.WriteErrorResponse(w, r, s3err.ErrMalformedExpires)
|
s3err.WriteErrorResponse(w, r, s3err.ErrMalformedDate)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue