functions
functions copied to clipboard
fix: allow returning `Response` objects from function Handlers
Which problem is this pull request solving?
Per the functions documentation, it seems like you should be able to return a standard Response object from function handlers. However, the existing types only allows a user to return a HandlerResponse object.
List other issues or pull requests related to this problem
It looks like https://github.com/netlify/functions/pull/351 also addresses this issue, but that PR is a little stale at this point.
Describe the solution you've chosen
This updates the Handler type to accept both HandlerResponse and Response as a return value.
Checklist
Please add a x inside each checkbox:
- [x] I have read the contribution guidelines.
- [ ] The status checks are successful (continuous integration). Those can be seen below.
Hey Nathan, appreciate the PR! The Handler type is for Lambda Compatibility Mode, which doesn't support Response. So the change you're proposing won't work.