Allow Origin header to be set (for non-browser platforms).#888
Conversation
🦋 Changeset detectedLatest commit: 695dc5c The changes in this PR will be included in the next version bump. This PR includes changesets to release 41 packages
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 |
There was a problem hiding this comment.
Take a look at what we did with Accept-Encoding to make it a runtime error when supplied in a non-Node context. Could you do something similar when Origin is supplied in a non-React-Native context? Should we actually allow Origin in all non-browser contexts, but make it a runtime error in browser contexts?
|
@steveluscher thanks for the review! IMO it feels reasonable to allow this header across the board: browsers will just ignore it anyways + the use case I cite here could apply to any non-browser environment? But won't die on this hill, happy to make the change if you'd like. |
The goal of the type system is to alert the developer of invalid inputs before they run their software, and the goal of runtime invariants is to alert them of invalid inputs the moment the call is made. Now type enforcement is not possible here just for browser builds, since TypeScript doesn't have the concept of ‘use these types for browser builds only,’ but if we take away the runtime enforcement then that will leave the developer on a treasure hunt for why their |
|
@steveluscher made the change - lmk if it looks good. will leave it to you to decide in the future whether this should be an error in Node envs, this change should unblock React Native users. |
BundleMonUnchanged files (130)
Total files change +3B 0% Final result: ✅ View report in BundleMon website ➡️ |
|
🔎💬 Inkeep AI search and chat service is syncing content for source 'Solana Kit Docs' |
|
Because there has been no activity on this PR for 14 days since it was merged, it has been automatically locked. Please open a new issue if it requires a follow up. |
Problem
As described in the ticket, React Native clients do not automatically set an Origin header. This is preventing us from using Triton's SWQOS since it restricts access by Origin header.
Summary of Changes
Remove Origin from list of forbidden headers.
Fixes #887