Skip to content

Commit

Permalink
add Util.isNoContentHttpCode(code)
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzhenn committed Oct 12, 2024
1 parent 596c824 commit 6e1a5f6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/util/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -530,3 +530,9 @@ export function calCanvasSize(size: { width: number, height: number }, devicePix
CANVAS_SIZE_TEMP.height = Math.round(height * devicePixelRatio);
return CANVAS_SIZE_TEMP;
}

export function isNoContentHttpCode(code: number) {
// https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
// 501 Not Implemented
return code === 204 || code >= 400 && code < 500 || code === 501;
}

0 comments on commit 6e1a5f6

Please sign in to comment.