test media del
This commit is contained in:
@@ -102,11 +102,19 @@ func (server *Server) apiV0MediaIDHandler(w http.ResponseWriter, r *http.Request
|
||||
switch r.Method {
|
||||
case http.MethodGet:
|
||||
return server.apiV0MediaIDGetHandler(w, r)
|
||||
case http.MethodDelete:
|
||||
return server.apiV0MediaIDDelHandler(w, r)
|
||||
}
|
||||
http.NotFound(w, r)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (server *Server) apiV0MediaIDDelHandler(w http.ResponseWriter, r *http.Request) error {
|
||||
id := path.Base(r.URL.Path)
|
||||
os.Remove(server.diskMediaPath(id))
|
||||
return nil
|
||||
}
|
||||
|
||||
func (server *Server) apiV0MediaIDGetHandler(w http.ResponseWriter, r *http.Request) error {
|
||||
id := path.Base(r.URL.Path)
|
||||
f, err := os.Open(server.diskMediaPath(id))
|
||||
|
||||
Reference in New Issue
Block a user