Move RecoverPanics to be the top level wrapped handler. Add new method to be sure a logger has been generated instead of assuming one has. Move regexp list compilation into a utility and pass regexp list into CORS.

This commit is contained in:
Jessica Forrester
2014-09-04 13:55:30 -04:00
parent 8b4ca9c2a7
commit becf6ca4e7
8 changed files with 38 additions and 21 deletions

View File

@@ -42,7 +42,7 @@ func (h *RESTHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
}
storage := h.storage[parts[0]]
if storage == nil {
httplog.LogOf(w).Addf("'%v' has no storage object", parts[0])
httplog.FindOrCreateLogOf(req, &w).Addf("'%v' has no storage object", parts[0])
notFound(w, req)
return
}