feat: add fetchOptions to core and react so Origin header can be sent on RN#74
Conversation
e94d813 to
de941af
Compare
6d3fa6a to
49a2c93
Compare
de941af to
6e07c19
Compare
49a2c93 to
9631468
Compare
9631468 to
5dfaff7
Compare
6e07c19 to
ca5f62a
Compare
5dfaff7 to
ed19d1b
Compare
ca5f62a to
4bcc9a3
Compare
|
I'll actually change this so we pass in an |
ed19d1b to
64aaa8d
Compare
4bcc9a3 to
5b62471
Compare
5b62471 to
529ba6c
Compare
64aaa8d to
1be46e0
Compare
SahilVasava
left a comment
There was a problem hiding this comment.
Direction is right — fetchOptions is the right plumbing for RN's Origin-header use case, and the Omit<RequestInit, 'body' | 'method' | 'signal'> is the correct restriction (SDK builds body, sets method, controls signal).
Two cleanup suggestions inline:
- Reuse
CreateTransportOptions['fetchOptions']instead of duplicating the Omit - Hoist
{ fetchOptions: params.fetchOptions }once instead of repeating it four times
(Out of scope: the user's fetchOptions.headers can override SDK's Content-Type due to merge order in rest.ts:52-56. Pre-existing, worth a follow-up but doesn't block this.)
1be46e0 to
1609ff9
Compare
0259805 to
5567f74
Compare
5567f74 to
6b4a7c0
Compare
48228c1 to
bacc73c
Compare
6b4a7c0 to
87253c6
Compare
87253c6 to
fd133a8
Compare
bacc73c to
3bdb8a3
Compare
fd133a8 to
eb9665f
Compare
3bdb8a3 to
66555a7
Compare
66555a7 to
c6d9181
Compare
9441987 to
cb83a89
Compare
c6d9181 to
bdf379f
Compare
SahilVasava
left a comment
There was a problem hiding this comment.
LGTM — type duplication removed (uses CreateTransportOptions['fetchOptions']) and the repeated { fetchOptions: params.fetchOptions } is now a single httpOpts local.
cb83a89 to
5ce572d
Compare
bdf379f to
57273e4
Compare
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
57273e4 to
b980e22
Compare
5ce572d to
9e9a6db
Compare
b980e22 to
3752741
Compare
This PR is part of a stack created with Aviator.
mainPart of FS-1971
fetchdoesn't automatically sendOriginheaders on React Native as there's no concept of a domain there. (It sends an IP instead.) So I solved this by passing through theOriginheaders instead configurable via thewallet-reactandwallet-coreentrypoints.We definitely have to come up with a better solution to this, but for the purpose of testing this works. I'm totally fine not merging this.