1. pass through http response headers

2. set http status 201 for creating files
This commit is contained in:
Chris Lu 2014-07-21 14:25:51 -07:00
parent a3fb644d86
commit 5d88cec2df

View file

@ -100,6 +100,9 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request,
return return
} }
defer resp.Body.Close() defer resp.Body.Close()
for k, v := range resp.Header {
w.Header()[k] = v
}
io.Copy(w, resp.Body) io.Copy(w, resp.Body)
} }
@ -169,6 +172,7 @@ func (fs *FilerServer) PostHandler(w http.ResponseWriter, r *http.Request) {
writeJsonError(w, r, db_err) writeJsonError(w, r, db_err)
return return
} }
w.WriteHeader(http.StatusCreated)
} }
// curl -X DELETE http://localhost:8888/path/to // curl -X DELETE http://localhost:8888/path/to