Skip to content

Commit

Permalink
Improve loghttp doc.
Browse files Browse the repository at this point in the history
It was a bit stale.
  • Loading branch information
maruel committed Aug 13, 2017
1 parent 1c4c654 commit 8b89ec2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions loghttp/loghttp.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@ import (
"time"
)

// Handler wraps a http.Handler and provides an hook before and after each
// request is processed.
// Handler wraps a http.Handler and logs the request and response.
//
// It handles Hijack() for websocket support.
type Handler struct {
http.Handler

unused struct{}
}

// ServeHTTP implements http.Handler.
//
// It logs the handler's HTTP status code and the response size.
func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
received := time.Now()
rwh := responseWriteHijacker{responseWriter: responseWriter{ResponseWriter: w}}
Expand Down

0 comments on commit 8b89ec2

Please sign in to comment.