mirror of
https://github.com/restic/rest-server.git
synced 2025-10-19 07:33:21 +00:00
improved repository with ioutil and added tests
This commit is contained in:
parent
e69d5b7615
commit
016bbf619a
3 changed files with 65 additions and 6 deletions
|
@ -151,8 +151,8 @@ func GetBlob(w http.ResponseWriter, r *http.Request, c *Context) {
|
|||
http.NotFound(w, r)
|
||||
return
|
||||
}
|
||||
blob, errr := repo.ReadBlob(bt, id)
|
||||
if errr != nil {
|
||||
blob, err := repo.ReadBlob(bt, id)
|
||||
if err != nil {
|
||||
http.NotFound(w, r)
|
||||
return
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ func PostBlob(w http.ResponseWriter, r *http.Request, c *Context) {
|
|||
http.NotFound(w, r)
|
||||
return
|
||||
}
|
||||
w.WriteHeader(201)
|
||||
w.WriteHeader(200)
|
||||
}
|
||||
|
||||
func DeleteBlob(w http.ResponseWriter, r *http.Request, c *Context) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue