Skip to content

Commit 38a0191

Browse files
committedNov 19, 2024··
fix(handler): Response options status and statusText are optional
Closes #133
1 parent 53aed97 commit 38a0191

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/handler.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ function isResponse(val: unknown): val is Response {
125125

126126
// Make sure the contents of init match ResponseInit
127127
const init = val[1];
128-
if (typeof init.status !== 'number') return false;
129-
if (typeof init.statusText !== 'string') return false;
128+
if (init.status && typeof init.status !== 'number') return false;
129+
if (init.statusText && typeof init.statusText !== 'string') return false;
130130
if (init.headers && !isObject(init.headers)) return false;
131131

132132
return true;

0 commit comments

Comments
 (0)
Please sign in to comment.