Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): error with status code when respo…
Browse files Browse the repository at this point in the history
…nse 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.
  • Loading branch information
alan-agius4 committed Feb 2, 2021
1 parent e1efc35 commit 21a05d2
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -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));
Expand Down

0 comments on commit 21a05d2

Please sign in to comment.