Skip to content

Commit

Permalink
fix(GODT-2757): Do not use auto-formatting for elapsed command time
Browse files Browse the repository at this point in the history
This can cause non-ASCII symbols to be printed in the response which is
not supported by the IMAP protocol.

Closes: #375
  • Loading branch information
LBeernaertProton committed Jul 7, 2023
1 parent a9327fb commit e8f6a4e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/session/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ func startTimeFromContext(ctx context.Context) (time.Time, bool) {

func okMessage(ctx context.Context) string {
if startTime, ok := startTimeFromContext(ctx); ok {
return fmt.Sprintf("command completed in %v", time.Since(startTime))
elapsed := time.Since(startTime)
microSec := elapsed.Microseconds()

return fmt.Sprintf("command completed in %v microsec.", microSec)
}

return ""
Expand Down

0 comments on commit e8f6a4e

Please sign in to comment.