MCPcopy Create free account
hub / github.com/BrainicHQ/DoHSpeedTest / testPostCors

Function testPostCors

script.js:1180–1189  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1178 };
1179
1180 const testPostCors = async () => {
1181 if (usesJsonApi) return { success: false, cors: false };
1182 const response = await withTimeout(url, {
1183 method: 'POST', mode: 'cors',
1184 headers: { 'Content-Type': 'application/dns-message', ...DNS_MESSAGE_HEADERS },
1185 body: dnsQuery
1186 });
1187 if (!response) return { success: false, cors: false };
1188 return { success: response.ok, cors: response.type === 'cors' };
1189 };
1190
1191 const [getCors, postCors, getNoCors] = await Promise.all([
1192 testGet('cors'), testPostCors(), testGet('no-cors')

Callers 1

checkServerCapabilitiesFunction · 0.85

Calls 1

withTimeoutFunction · 0.85

Tested by

no test coverage detected