Merge pull request #1350 from versity/ben/log-crash

This commit is contained in:
Ben McClelland
2025-06-19 12:34:54 -07:00
committed by GitHub

View File

@@ -74,7 +74,10 @@ func (f *FileLogger) Log(ctx *fiber.Ctx, err error, body []byte, meta LogMeta) {
}
errorCode := ""
httpStatus := 200
startTime := ctx.Locals("startTime").(time.Time)
startTime, ok := ctx.Locals("startTime").(time.Time)
if !ok {
startTime = time.Now()
}
tlsConnState := ctx.Context().TLSConnectionState()
if tlsConnState != nil {
lf.CipherSuite = tls.CipherSuiteName(tlsConnState.CipherSuite)