mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
fix(coderd): fix panics by always checking for non-nil request logger (#18228)
This commit is contained in:
committed by
GitHub
parent
c95d972d4e
commit
70723d3b51
@ -384,7 +384,9 @@ func (api *API) provisionerDaemonServe(rw http.ResponseWriter, r *http.Request)
|
||||
})
|
||||
|
||||
// Log the request immediately instead of after it completes.
|
||||
loggermw.RequestLoggerFromContext(ctx).WriteLog(ctx, http.StatusAccepted)
|
||||
if rl := loggermw.RequestLoggerFromContext(ctx); rl != nil {
|
||||
rl.WriteLog(ctx, http.StatusAccepted)
|
||||
}
|
||||
|
||||
err = server.Serve(ctx, session)
|
||||
srvCancel()
|
||||
|
Reference in New Issue
Block a user