-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow modifying trustless-gateway fetch #751
base: main
Are you sure you want to change the base?
feat: allow modifying trustless-gateway fetch #751
Conversation
Added an optional `headers` property to the `TrustlessGatewayBlockBroker` and `TrustlessGatewaySession` options, allowing users to specify custom headers for HTTP requests. Changes include: * Added `headers` property to `TrustlessGatewayBlockBroker` and `TrustlessGatewaySession` options * Updated `findHttpGatewayProviders` function to accept an optional `headers` object * Passed `headers` object to `TrustlessGateway` constructor * Updated `TrustlessGateway` constructor to accept an optional `headers` object * Added `headers` to HTTP request options in `TrustlessGateway`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self review
@pcfreak30 can you confirm this will work for your use-case? cc @achingbrain |
At a glance, yes. primary use case is a JWT. |
I'll need to look further into the chrome failures later. I was able to reproduce these locally fixed with |
Title
feat: allow modifying trustless-gateway fetch
Description
This PR allows consumers to modify headers and any other RequestInit options that trustless-gateways use when making a fetch request to a trustless gateway.
This allows consumers to add JWT tokens to the request, or modifying the request in a variety of other ways. If the user does not modify the requestInit object, the default behavior is to use the same requestInit object that was used prior to this PR.
Fixes #659
Replaces #732
Notes & open questions
Change checklist