The access logger takes the status code, which is being logged, from the LogResponseWriter. If the c.Next() handler does not use WriteHeader, but instead returns a HTTPError, the access logger will log the request with a 200 OK status. (e.g. if serving static files and the requested file does not exist, status code in log will be 200 and not the returned 404)
To fix this, we need to check the error object returned by c.Next() and use its status code if available.
Coverage remained the same at 95.089% when pulling 1a17ad49edb50c9fa1a96c53c77f1e0acbbacd67 on studio-b12:master into 8c1099aeb3317626e959210556e96b0c77915b14 on go-ozzo:master.
The access logger takes the status code, which is being logged, from the LogResponseWriter. If the c.Next() handler does not use WriteHeader, but instead returns a HTTPError, the access logger will log the request with a 200 OK status. (e.g. if serving static files and the requested file does not exist, status code in log will be 200 and not the returned 404) To fix this, we need to check the error object returned by c.Next() and use its status code if available.