Return 404 if file does not exist

This commit is contained in:
Felix Geisendörfer 2013-03-21 14:17:07 +01:00
parent 0e217d86d9
commit 96b92970dd
1 changed files with 4 additions and 1 deletions

View File

@ -192,7 +192,10 @@ func putFile(w http.ResponseWriter, r *http.Request, fileId string) {
func setFileRangeHeader(w http.ResponseWriter, fileId string) {
meta, err := dataStore.GetFileMeta(fileId)
if err != nil {
if os.IsNotExist(err) {
reply(w, http.StatusNotFound, err.Error())
return
} else if err != nil {
reply(w, http.StatusInternalServerError, err.Error())
return
}