mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-18 03:23:57 +08:00
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:
parent
e1efc35e41
commit
21a05d2ea0
@ -120,6 +120,12 @@ export class InlineFontsProcessor {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
res => {
|
res => {
|
||||||
|
if (res.statusCode !== 200) {
|
||||||
|
reject(new Error(`Inlining of fonts failed. ${url} returned status code: ${res.statusCode}.`));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
res
|
res
|
||||||
.on('data', chunk => rawResponse += chunk)
|
.on('data', chunk => rawResponse += chunk)
|
||||||
.on('end', () => resolve(rawResponse));
|
.on('end', () => resolve(rawResponse));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user