Return error when GET returns a non-plain text file

This commit is contained in:
Raymond Hill 2023-03-28 08:38:34 -04:00
parent 8507d637e5
commit 198c20db76
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 1 additions and 0 deletions

View File

@ -202,6 +202,7 @@ assets.fetchText = async function(url) {
const text = details.content.trim(); const text = details.content.trim();
if ( text.startsWith('<') && text.endsWith('>') ) { if ( text.startsWith('<') && text.endsWith('>') ) {
details.content = ''; details.content = '';
details.error = 'assets.fetchText(): Not a text file';
} }
// Important: Non empty text resource must always end with a newline // Important: Non empty text resource must always end with a newline