Skip to content

Commit 21a05d2

Browse files
committed
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.
1 parent e1efc35 commit 21a05d2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/angular_devkit/build_angular/src/utils/index-file/inline-fonts.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ export class InlineFontsProcessor {
120120
},
121121
},
122122
res => {
123+
if (res.statusCode !== 200) {
124+
reject(new Error(`Inlining of fonts failed. ${url} returned status code: ${res.statusCode}.`));
125+
126+
return;
127+
}
128+
123129
res
124130
.on('data', chunk => rawResponse += chunk)
125131
.on('end', () => resolve(rawResponse));

0 commit comments

Comments
 (0)