Skip to content

Commit 4dfba53

Browse files
fix: check bad content-type
1 parent d82e6f9 commit 4dfba53

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/utils/resolveDappAddressFromCompass.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ export async function resolveDappAddressFromCompass(
3636
`Failed to fetch dapp address from compass: ${response.statusText}`
3737
);
3838
}
39-
if (response.headers.get('Content-Type') !== 'application/json') {
39+
const contentType = response.headers.get('Content-Type');
40+
if (!contentType || contentType.indexOf('application/json') === -1) {
4041
throw new Error(
4142
'Failed to fetch dapp address from compass: response is not JSON'
4243
);

0 commit comments

Comments
 (0)