Fix #17730 - Dev mode has new line (#18367)

* adding new line only in case of pretty in url not in dev mode

* change log added
This commit is contained in:
Ashesh Vidyut 2023-08-05 08:15:24 +05:30 committed by GitHub
parent 38c356c39b
commit 417ae9fc39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

3
.changelog/18367.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
dev-mode: Fix dev mode has new line in responses. Now new line is added only when url has pretty query parameter.
```

View File

@ -616,7 +616,9 @@ func (s *HTTPHandlers) marshalJSON(req *http.Request, obj interface{}) ([]byte,
if err != nil {
return nil, err
}
buf = append(buf, "\n"...)
if ok {
buf = append(buf, "\n"...)
}
return buf, nil
}