This commit is contained in:
Yanlong Wang 2024-09-12 19:50:46 +08:00
parent 1bd3ed7125
commit f8bc4877ef
No known key found for this signature in database
GPG Key ID: C0A623C0BADF9F37

View File

@ -328,7 +328,7 @@ export class SnapshotFormatter extends AsyncService {
if (snapshot.status) { if (snapshot.status) {
const code = snapshot.status; const code = snapshot.status;
const n = code - 200; const n = code - 200;
if (n < 100 || n >= 100) { if (n < 0 || n >= 100) {
const text = snapshot.statusText || STATUS_CODES[code]; const text = snapshot.statusText || STATUS_CODES[code];
formatted.warning = `Target URL returned error ${code}${text? `: ${text}` : ''}`; formatted.warning = `Target URL returned error ${code}${text? `: ${text}` : ''}`;
} }
@ -436,7 +436,7 @@ ${suffixMixins.length ? `\n${suffixMixins.join('\n\n')}\n` : ''}`;
if (snapshot.status) { if (snapshot.status) {
const code = snapshot.status; const code = snapshot.status;
const n = code - 200; const n = code - 200;
if (n < 100 || n >= 100) { if (n < 0 || n >= 100) {
const text = snapshot.statusText || STATUS_CODES[code]; const text = snapshot.statusText || STATUS_CODES[code];
mixin.warning = `Target URL returned error ${code}${text ? `: ${text}` : ''}`; mixin.warning = `Target URL returned error ${code}${text ? `: ${text}` : ''}`;
} }