go fmt
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
package command
|
package command
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/chrislusf/seaweedfs/weed/server"
|
|
||||||
"github.com/spf13/viper"
|
|
||||||
"github.com/chrislusf/seaweedfs/weed/filer2"
|
"github.com/chrislusf/seaweedfs/weed/filer2"
|
||||||
"github.com/chrislusf/seaweedfs/weed/glog"
|
"github.com/chrislusf/seaweedfs/weed/glog"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/server"
|
||||||
|
"github.com/spf13/viper"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ import (
|
|||||||
"bufio"
|
"bufio"
|
||||||
"bytes"
|
"bytes"
|
||||||
"errors"
|
"errors"
|
||||||
|
"github.com/dustin/go-humanize"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"github.com/dustin/go-humanize"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Streaming AWS Signature Version '4' constants.
|
// Streaming AWS Signature Version '4' constants.
|
||||||
@@ -43,7 +43,7 @@ var errMalformedEncoding = errors.New("malformed chunked encoding")
|
|||||||
// newSignV4ChunkedReader returns a new s3ChunkedReader that translates the data read from r
|
// newSignV4ChunkedReader returns a new s3ChunkedReader that translates the data read from r
|
||||||
// out of HTTP "chunked" format before returning it.
|
// out of HTTP "chunked" format before returning it.
|
||||||
// The s3ChunkedReader returns io.EOF when the final 0-length chunk is read.
|
// The s3ChunkedReader returns io.EOF when the final 0-length chunk is read.
|
||||||
func newSignV4ChunkedReader(req *http.Request) (io.ReadCloser) {
|
func newSignV4ChunkedReader(req *http.Request) io.ReadCloser {
|
||||||
return &s3ChunkedReader{
|
return &s3ChunkedReader{
|
||||||
reader: bufio.NewReader(req.Body),
|
reader: bufio.NewReader(req.Body),
|
||||||
state: readChunkHeader,
|
state: readChunkHeader,
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
package s3api
|
package s3api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
|
|
||||||
"time"
|
|
||||||
"os"
|
|
||||||
"fmt"
|
|
||||||
"github.com/chrislusf/glog"
|
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/glog"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s3a *S3ApiServer) mkdir(parentDirectoryPath string, dirName string) error {
|
func (s3a *S3ApiServer) mkdir(parentDirectoryPath string, dirName string) error {
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import (
|
|||||||
|
|
||||||
// AWS Signature Version '4' constants.
|
// AWS Signature Version '4' constants.
|
||||||
const (
|
const (
|
||||||
signV4Algorithm = "AWS4-HMAC-SHA256"
|
signV4Algorithm = "AWS4-HMAC-SHA256"
|
||||||
signV2Algorithm = "AWS"
|
signV2Algorithm = "AWS"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Verify if request has JWT.
|
// Verify if request has JWT.
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ func (s3a *S3ApiServer) PutObjectHandler(w http.ResponseWriter, r *http.Request)
|
|||||||
|
|
||||||
rAuthType := getRequestAuthType(r)
|
rAuthType := getRequestAuthType(r)
|
||||||
dataReader := r.Body
|
dataReader := r.Body
|
||||||
if rAuthType == authTypeStreamingSigned{
|
if rAuthType == authTypeStreamingSigned {
|
||||||
dataReader = newSignV4ChunkedReader(r)
|
dataReader = newSignV4ChunkedReader(r)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user