Closed doseofted closed 1 year ago
Latest commit: 77450a23858813a5ab155f3d80b507f76dcae4eb
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
prim-rpc | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Sep 28, 2023 10:00pm |
The Fetch API doesn't have the same options available in many server frameworks, like connect middleware or plugins. Instead, changes are made directly to the Request/Response objects. This PR will add two new options, "preprocess" to modify the Request before being given to Prim+RPC and "postprocess" to manipulate the Response created by Prim+RPC.
This will allow headers to be set (specifically CORS and CSP) without explicitly providing limited "options" for the plugin.
This also adds support for using Fetch with Node using @whatwg-node/server (previously didn't work due to usage of
instanceof
on ponyfilled objects).