(mode)
| 1169 | }; |
| 1170 | |
| 1171 | const testGet = async (mode) => { |
| 1172 | const urlToUse = usesJsonApi ? jsonGetUrl : wireGetUrl; |
| 1173 | const headers = usesJsonApi ? DNS_JSON_HEADERS : DNS_MESSAGE_HEADERS; |
| 1174 | const response = await withTimeout(urlToUse, { method: 'GET', mode, headers }); |
| 1175 | if (!response) return { success: false, cors: false }; |
| 1176 | if (mode === 'cors') return { success: response.ok, cors: response.type === 'cors' }; |
| 1177 | return { success: true, cors: false }; |
| 1178 | }; |
| 1179 | |
| 1180 | const testPostCors = async () => { |
| 1181 | if (usesJsonApi) return { success: false, cors: false }; |
no test coverage detected