Skip to content

Commit

Permalink
fix: (probably temporary) added cors header in requests
Browse files Browse the repository at this point in the history
  • Loading branch information
amessbee committed Jul 12, 2024
1 parent dd791bc commit f7efe5d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion contract/tools/ui-kit-goals/makeHttpClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ const filterBadStatus = res => {
* @returns {import('@cosmjs/tendermint-rpc').RpcClient}
*/
export const makeHttpClient = (url, fetch) => {
const headers = {}; // XXX needed?
const headers = {'Access-Control-Allow-Origin': '*'
}; // XXX needed?

// based on cosmjs 0.30.1:
// https://github.com/cosmos/cosmjs/blob/33271bc51cdc865cadb647a1b7ab55d873637f39/packages/tendermint-rpc/src/rpcclients/http.ts#L37
Expand Down Expand Up @@ -80,6 +81,7 @@ export const makeAPI = (apiAddress, { fetch }) => {
keepalive: true,
headers: {
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*',
...options.headers,
},
};
Expand Down

0 comments on commit f7efe5d

Please sign in to comment.