diff --git a/client/src/utils.js b/client/src/utils.js index 25a2143..3316387 100644 --- a/client/src/utils.js +++ b/client/src/utils.js @@ -14,7 +14,9 @@ export async function sendCommand(command, value) { const endpoint = getEndpoint() const url = new URL(`/get?command=${command}&value=${value}`, endpoint) - const response = await fetch(url) + const response = await fetch(url, { + mode: 'no-cors' + }) const text = await response.text() console.log(text) } @@ -54,7 +56,10 @@ export function setEndpoint(endpoint) { */ export async function testEndpoint(endpoint) { try { - const response = await fetch(endpoint) + const url = new URL('/get', endpoint) + const response = await fetch(url, { + mode: 'no-cors' + }) if (response.ok) return } catch (cause) { alert(`Impossible de joindre l'adresse "${endpoint}"`)