Correctly log and return after serving static file
This commit is contained in:
parent
7dc620aff1
commit
44a4fd7a79
1 changed files with 7 additions and 0 deletions
|
@ -437,8 +437,15 @@ func (h *Handler) WebErrors(f handlerFunc, ul UserLevelFunc) http.HandlerFunc {
|
||||||
|
|
||||||
func (h *Handler) CollectionPostOrStatic(w http.ResponseWriter, r *http.Request) {
|
func (h *Handler) CollectionPostOrStatic(w http.ResponseWriter, r *http.Request) {
|
||||||
if strings.Contains(r.URL.Path, ".") && !isRaw(r) {
|
if strings.Contains(r.URL.Path, ".") && !isRaw(r) {
|
||||||
|
start := time.Now()
|
||||||
|
status := 200
|
||||||
|
defer func() {
|
||||||
|
log.Info("\"%s %s\" %d %s \"%s\"", r.Method, r.RequestURI, status, time.Since(start), r.UserAgent())
|
||||||
|
}()
|
||||||
|
|
||||||
// Serve static file
|
// Serve static file
|
||||||
h.app.App().shttp.ServeHTTP(w, r)
|
h.app.App().shttp.ServeHTTP(w, r)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
h.Web(viewCollectionPost, UserLevelReader)(w, r)
|
h.Web(viewCollectionPost, UserLevelReader)(w, r)
|
||||||
|
|
Loading…
Add table
Reference in a new issue