improved repository with ioutil and added tests

This commit is contained in:
Chapuis Bertil 2015-09-09 11:21:15 +02:00
parent e69d5b7615
commit 016bbf619a
3 changed files with 65 additions and 6 deletions

View file

@ -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) {