make lokiPlainFetch return a SnodeResponse object

pull/1287/head
Audric Ackermann 5 years ago
parent 2503b089d6
commit 52cb50f063
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -30,15 +30,12 @@ async function lokiPlainFetch(
if (!response.ok) {
throw new window.textsecure.HTTPError('Loki_rpc error', response);
}
const result = await response.text();
let result;
if (response.headers.get('Content-Type') === 'application/json') {
result = await response.json();
} else {
result = await response.text();
}
return result;
return {
body: result,
status: response.status,
};
}
interface FetchOptions {

Loading…
Cancel
Save