diff options
| author | Chris Lu <chris.lu@gmail.com> | 2018-07-18 02:39:12 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2018-07-18 02:39:12 -0700 |
| commit | 702fbdf7310aa266bc0854492a83589d663d803e (patch) | |
| tree | fccfb19c23a9e89a3ec77e4fbdd7c37e49794349 /weed/s3api/s3api_headers.go | |
| parent | 834a25f0840c0dfbf3b27006f419d7e2d5f25b90 (diff) | |
| download | seaweedfs-702fbdf7310aa266bc0854492a83589d663d803e.tar.xz seaweedfs-702fbdf7310aa266bc0854492a83589d663d803e.zip | |
refactoring
Diffstat (limited to 'weed/s3api/s3api_headers.go')
| -rw-r--r-- | weed/s3api/s3api_headers.go | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/weed/s3api/s3api_headers.go b/weed/s3api/s3api_headers.go deleted file mode 100644 index ff9bfc2ed..000000000 --- a/weed/s3api/s3api_headers.go +++ /dev/null @@ -1,31 +0,0 @@ -package s3api - -import ( - "bytes" - "encoding/xml" - "fmt" - "net/http" - "time" -) - -type mimeType string - -const ( - mimeNone mimeType = "" - mimeJSON mimeType = "application/json" - mimeXML mimeType = "application/xml" -) - -func setCommonHeaders(w http.ResponseWriter) { - w.Header().Set("x-amz-request-id", fmt.Sprintf("%d", time.Now().UnixNano())) - w.Header().Set("Accept-Ranges", "bytes") -} - -// Encodes the response headers into XML format. -func encodeResponse(response interface{}) []byte { - var bytesBuffer bytes.Buffer - bytesBuffer.WriteString(xml.Header) - e := xml.NewEncoder(&bytesBuffer) - e.Encode(response) - return bytesBuffer.Bytes() -} |
