mirror of https://github.com/gorhill/uBlock.git
Properly handle failed fetches in code viewer
This commit is contained in:
parent
0ba5ec162b
commit
c0529307fa
|
@ -105,9 +105,9 @@ async function fetchResource(url) {
|
|||
response = await fetch(url, fetchOptions);
|
||||
text = await response.text();
|
||||
} catch(reason) {
|
||||
text = reason;
|
||||
text = String(reason);
|
||||
}
|
||||
let mime = response.headers.get('Content-Type') || '';
|
||||
let mime = response && response.headers.get('Content-Type') || '';
|
||||
mime = mime.replace(/\s*;.*$/, '').trim();
|
||||
const beautifierOptions = {
|
||||
'end_with_newline': true,
|
||||
|
|
Loading…
Reference in New Issue