Skip to content

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

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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