fix(@angular-devkit/build-angular): error with status code when response code is not 200

During font inlining, a request can return a response status code other than 200. In which case, the contents of the page should not be inlined.
This commit is contained in:
Alan Agius 2021-02-02 09:45:13 +01:00
parent e1efc35e41
commit 21a05d2ea0

View File

@ -120,6 +120,12 @@ export class InlineFontsProcessor {
},
},
res => {
if (res.statusCode !== 200) {
reject(new Error(`Inlining of fonts failed. ${url} returned status code: ${res.statusCode}.`));
return;
}
res
.on('data', chunk => rawResponse += chunk)
.on('end', () => resolve(rawResponse));