feat: add `text/plain` fallback response
Based on the work in #56.
Adds a fallback text/plain response when the client does not accept html.
New dependencies detected. Learn more about Socket for GitHub ↗︎
| Package | New capabilities | Transitives | Size | Publisher |
|---|---|---|---|---|
| npm/[email protected] | None | 0 |
28.7 kB | wesleytodd |
@wesleytodd We maybe should use negotiator not accepts because negotiator is more lightweight compared to accepts and we don't need the mime types support from accepts.
Yeah, probably true. Frankly I dislike all the content type negotiation packages we have, they could use some consolidation and cleanup to make it more clear when to use which.
I don’t think we can include this in a 2.x release since it introduces a breaking change. Currently, finalhandler always returns a text/html response, and even though changing this might be more correct, it could still potentially break existing users relying on the current behavior.