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