|
|
|
@ -287,9 +287,13 @@ func (s *storageRESTServer) DeleteVersionHandler(w http.ResponseWriter, r *http. |
|
|
|
|
volume := vars[storageRESTVolume] |
|
|
|
|
filePath := vars[storageRESTFilePath] |
|
|
|
|
|
|
|
|
|
if r.ContentLength < 0 { |
|
|
|
|
s.writeErrorResponse(w, errInvalidArgument) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var fi FileInfo |
|
|
|
|
decoder := gob.NewDecoder(r.Body) |
|
|
|
|
if err := decoder.Decode(&fi); err != nil { |
|
|
|
|
if err := gob.NewDecoder(r.Body).Decode(&fi); err != nil { |
|
|
|
|
s.writeErrorResponse(w, err) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
@ -300,7 +304,7 @@ func (s *storageRESTServer) DeleteVersionHandler(w http.ResponseWriter, r *http. |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// ReadVersion delete updated metadata.
|
|
|
|
|
// ReadVersion read metadata of versionID
|
|
|
|
|
func (s *storageRESTServer) ReadVersionHandler(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
if !s.IsValid(w, r) { |
|
|
|
|
return |
|
|
|
@ -858,7 +862,7 @@ func registerStorageRESTHandlers(router *mux.Router, endpointZones EndpointZones |
|
|
|
|
subrouter.Methods(http.MethodPost).Path(storageRESTVersionPrefix + storageRESTMethodWriteMetadata).HandlerFunc(httpTraceHdrs(server.WriteMetadataHandler)). |
|
|
|
|
Queries(restQueries(storageRESTVolume, storageRESTFilePath)...) |
|
|
|
|
subrouter.Methods(http.MethodPost).Path(storageRESTVersionPrefix + storageRESTMethodDeleteVersion).HandlerFunc(httpTraceHdrs(server.DeleteVersionHandler)). |
|
|
|
|
Queries(restQueries(storageRESTVolume, storageRESTFilePath, storageRESTVersionID, storageRESTDeleteMarker)...) |
|
|
|
|
Queries(restQueries(storageRESTVolume, storageRESTFilePath)...) |
|
|
|
|
subrouter.Methods(http.MethodPost).Path(storageRESTVersionPrefix + storageRESTMethodReadVersion).HandlerFunc(httpTraceHdrs(server.ReadVersionHandler)). |
|
|
|
|
Queries(restQueries(storageRESTVolume, storageRESTFilePath, storageRESTVersionID)...) |
|
|
|
|
subrouter.Methods(http.MethodPost).Path(storageRESTVersionPrefix + storageRESTMethodRenameData).HandlerFunc(httpTraceHdrs(server.RenameDataHandler)). |
|
|
|
|