Skip to content

Commit 1d153f1

Browse files
committed
Update helper.ts
1 parent 29410f0 commit 1d153f1

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

apps/box/src/utils/helper.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ export const refreshRelayCache = async (): Promise<void> => {
4646
try {
4747
const r = await fetchWithTimeout(
4848
`${Constants.FXDiscoveryURL}/relays`,
49-
{ method: 'GET', headers: { accept: 'application/json' } },
49+
{ method: 'GET', headers: {
50+
accept: 'application/json',
51+
// Gate for the Cloudflare WAF rule that blocks unknown bot traffic.
52+
'x-fula-client': 'app',
53+
} },
5054
DISCOVERY_TIMEOUT_MS,
5155
);
5256
if (!r.ok) return;
@@ -73,7 +77,11 @@ export const findBox = async (bloxPeerId: string): Promise<string[]> => {
7377
`${Constants.FXDiscoveryURL}/find-box`,
7478
{
7579
method: 'POST',
76-
headers: { 'content-type': 'application/json', accept: 'application/json' },
80+
headers: {
81+
'content-type': 'application/json',
82+
accept: 'application/json',
83+
'x-fula-client': 'app',
84+
},
7785
body: JSON.stringify({ peerId: bloxPeerId }),
7886
},
7987
DISCOVERY_TIMEOUT_MS,

0 commit comments

Comments
 (0)