1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-31 18:31:01 +00:00

fix(api): return 500 response when JSON serialization fails

This commit is contained in:
Frédéric Guillot 2025-01-30 18:06:30 -08:00
parent c951ac2876
commit 3ebeb38ade
3 changed files with 64 additions and 22 deletions

View file

@ -25,7 +25,7 @@ type Builder struct {
statusCode int
headers map[string]string
enableCompression bool
body interface{}
body any
}
// WithStatus uses the given status code to build the response.
@ -41,7 +41,7 @@ func (b *Builder) WithHeader(key, value string) *Builder {
}
// WithBody uses the given body to build the response.
func (b *Builder) WithBody(body interface{}) *Builder {
func (b *Builder) WithBody(body any) *Builder {
b.body = body
return b
}