Skip to content

responder: skip status lookup when request is nil - #67

Open
team-humaki wants to merge 1 commit into
go-chi:masterfrom
team-humaki:json-nil-request
Open

team-humaki wants to merge 1 commit into
go-chi:masterfrom
team-humaki:json-nil-request

Conversation

@team-humaki

Copy link
Copy Markdown

JSON/XML/PlainText/Data/HTML used r.Context() to read a Status() hint and panicked when callers passed a nil *http.Request (wrappers that already wrote the status). Skip the hint when r is nil; Status() still works when a request is present.

Fixes #28

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

Successfully merging this pull request may close these issues.

Using render.JSON with no http Request object throws an error

1 participant