Collate success response into writeSuccessResponse(), add docs

This commit is contained in:
Harshavardhana
2015-04-29 10:51:59 -07:00
parent 45a0fb21fa
commit d1d5f7a78d
4 changed files with 19 additions and 12 deletions
+8
View File
@@ -109,6 +109,14 @@ func generateObjectsListResult(bucket string, objects []drivers.ObjectMetadata,
return data
}
// writeSuccessResponse - write success headers
func writeSuccessResponse(w http.ResponseWriter) {
w.Header().Set("Server", "Minio")
w.Header().Set("Connection", "close")
w.WriteHeader(http.StatusOK)
}
// writeErrorRespone - write error headers
func writeErrorResponse(w http.ResponseWriter, req *http.Request, errorType int, acceptsContentType contentType, resource string) {
error := getErrorCode(errorType)
errorResponse := getErrorResponse(error, resource)