Skip to content

Commit

Permalink
Merge pull request #12 from UiPath/feature/response-logger-new-line
Browse files Browse the repository at this point in the history
Add newline after printing response body
  • Loading branch information
thschmitt authored Jan 26, 2023
2 parents f9bd67e + 33bb04b commit 9526fd7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/execution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ paths:

expectedStdOut := `{
"hello": "world"
}`
}
`
if result.StdOut != expectedStdOut {
t.Errorf("Expected response body on stdout %v, got: %v", expectedStdOut, result.StdOut)
}
Expand Down
2 changes: 2 additions & 0 deletions utils/http_logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ func (l HttpLogger) LogResponse(response *http.Response) error {
response.Body = io.NopCloser(bytes.NewBuffer(body))
if len(body) == 0 && response.StatusCode >= 400 {
fmt.Fprintf(l.Output, "%s %s\n", response.Proto, response.Status)
} else {
fmt.Fprint(l.Output, "\n")
}
return err
}

0 comments on commit 9526fd7

Please sign in to comment.