mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
Properly handle failed fetches in code viewer
This commit is contained in:
parent
0ba5ec162b
commit
c0529307fa
1 changed files with 2 additions and 2 deletions
|
|
@ -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 a new issue