From c23186c5bd74408cecf05a311c8b2af59e7dea4d Mon Sep 17 00:00:00 2001 From: h0nIg Date: Mon, 2 Dec 2024 22:08:39 +0100 Subject: [PATCH] Displaybody should respect new line [v8] (#3151) * display body should respect new line --- util/ui/request_logger_file_writer.go | 2 +- util/ui/request_logger_file_writer_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/util/ui/request_logger_file_writer.go b/util/ui/request_logger_file_writer.go index a2d7aca1e2b..347c556d6cf 100644 --- a/util/ui/request_logger_file_writer.go +++ b/util/ui/request_logger_file_writer.go @@ -29,7 +29,7 @@ func newRequestLoggerFileWriter(ui *UI, lock *sync.Mutex, filePaths []string) *R func (display *RequestLoggerFileWriter) DisplayBody([]byte) error { for _, logFile := range display.logFiles { - _, err := logFile.WriteString(RedactedValue) + _, err := logFile.WriteString(fmt.Sprintf("%s\n", RedactedValue)) if err != nil { return err } diff --git a/util/ui/request_logger_file_writer_test.go b/util/ui/request_logger_file_writer_test.go index 780497bec0d..40f768f64c4 100644 --- a/util/ui/request_logger_file_writer_test.go +++ b/util/ui/request_logger_file_writer_test.go @@ -54,11 +54,11 @@ var _ = Describe("Request Logger File Writer", func() { contents, err := os.ReadFile(logFile1) Expect(err).ToNot(HaveOccurred()) - Expect(string(contents)).To(Equal(RedactedValue + "\n")) + Expect(string(contents)).To(Equal(RedactedValue + "\n\n")) contents, err = os.ReadFile(logFile2) Expect(err).ToNot(HaveOccurred()) - Expect(string(contents)).To(Equal(RedactedValue + "\n")) + Expect(string(contents)).To(Equal(RedactedValue + "\n\n")) }) })