lbry-desktop/ui/util/handle-fetch.js
jessopb 5f55603fb2
send recsys powered-by (#6875)
* send recsys powered-by

* update lighthouse call in useLighthouse

* rename select selectors

* update channel search too
2021-08-17 10:03:25 -04:00

9 lines
324 B
JavaScript

// @flow
export default function handleFetchResponse(response: Response): Promise<any> {
const headers = response.headers;
const poweredBy = headers.get('x-powered-by');
return response.status === 200
? response.json().then((body) => ({ body, poweredBy }))
: Promise.reject(new Error(response.statusText));
}