Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redundant escapeHTML Setting in go-chi/render #52

Open
knbr13 opened this issue Oct 15, 2023 · 0 comments
Open

Redundant escapeHTML Setting in go-chi/render #52

knbr13 opened this issue Oct 15, 2023 · 0 comments

Comments

@knbr13
Copy link
Contributor

knbr13 commented Oct 15, 2023

https://github.com/go-chi/render/blob/14f1cb3d5c2969d6e462632a205eacb6421eb4dc/responder.go#L95C2-L96C25

In the responder.go file, the JSON function sets escapeHTML to true.
However, the json.NewEncoder defaults to escapeHTML: true.
This appears to be redundant.

Source code for json.NewEncoder:

func NewEncoder(w io.Writer) *Encoder {
	return &Encoder{w: w, escapeHTML: true}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant