cmorten / opine

Minimalist web framework for Deno ported from ExpressJS.
https://github.com/cmorten/opine/blob/main/.github/API/api.md
MIT License
854 stars 43 forks source link

res.setHeader is not a function #126

Closed TillaTheHun0 closed 3 years ago

TillaTheHun0 commented 3 years ago

Issue

Came across this when trying to use helmet with opine. Helmet uses res.setHeader in its middleware that it applies, which produces an error with opine

Setup:

In express/node, res.setHeader comes from node's http.Response object, and res.set eventually calls into that. With deno/opine, I believe res.setHeader could just be made an alias for res.set, sort of the reverse of the relationship in node/express, but achieves the same api.

edit: clarification on where res.setHeader is derived from