Skip to content

Commit

Permalink
Fix: Response.error().ok === false (#1412)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmann100 committed Dec 13, 2023
1 parent 84256c8 commit 27e1c75
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions fetch.js
Expand Up @@ -493,6 +493,7 @@ Response.prototype.clone = function() {

Response.error = function() {
var response = new Response(null, {status: 200, statusText: ''})
response.ok = false
response.status = 0
response.type = 'error'
return response
Expand Down
1 change: 1 addition & 0 deletions test/test.js
Expand Up @@ -696,6 +696,7 @@ exercise.forEach(function(exerciseMode) {
test('error creates error Response', function() {
var r = Response.error()
assert(r instanceof Response)
assert.equal(r.ok, false)
assert.equal(r.status, 0)
assert.equal(r.statusText, '')
assert.equal(r.type, 'error')
Expand Down

0 comments on commit 27e1c75

Please sign in to comment.