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 authored Dec 13, 2023
1 parent 84256c8 commit 27e1c75
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions fetch.js
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -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')

0 comments on commit 27e1c75

Please sign in to comment.