Skip to content

Any concern render.JSON() can leak internal errors to outside? #57

@trantienduchn

Description

@trantienduchn

Hi, the JSON rendering code seems to expose direct encoding errors to outside
https://github.com/go-chi/render/blob/master/responder.go#L98

	if err := enc.Encode(v); err != nil {
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
	}

would it be better to add another function argument to render.JSON() or something, rather than exposing library error messages?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions