diff options
author | Ben Morrison <ben@gbmor.dev> | 2019-12-19 21:21:56 -0500 |
---|---|---|
committer | Ben Morrison <ben@gbmor.dev> | 2019-12-19 21:21:56 -0500 |
commit | e53b843a93922f21289b9fc4958f1dfc47a49bdf (patch) | |
tree | a98cc9358ccf773a7615b42802bb825d7be0bc0d /svc/http.go | |
parent | 7db28dd705dd5463b5e2e9cf6f5fc87db25533ad (diff) | |
download | getwtxt-e53b843a93922f21289b9fc4958f1dfc47a49bdf.tar.gz |
some functions were missing comments. added those in where needed.
Diffstat (limited to 'svc/http.go')
-rw-r--r-- | svc/http.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/svc/http.go b/svc/http.go index 0c1d7e8..6350e9e 100644 --- a/svc/http.go +++ b/svc/http.go @@ -78,12 +78,15 @@ func ipMiddleware(hop http.Handler) http.Handler { }) } +// Appends a 200 OK to the request log func log200(r *http.Request) { useragent := r.Header["User-Agent"] uip := getIPFromCtx(r.Context()) reqLog.Printf("*** %v :: 200 :: %v %v :: %v\n", uip, r.Method, r.URL, useragent) } +// Appends a request of a given status code to the request +// log. Intended for errors. func errHTTP(w http.ResponseWriter, r *http.Request, err error, code int) { useragent := r.Header["User-Agent"] uip := getIPFromCtx(r.Context()) |