Skip to content

Commit

Permalink
patch: Mark 404 as a successful response
Browse files Browse the repository at this point in the history
This is discussed in detail several places, e.g:
hotwired#188 (comment)
  • Loading branch information
bep committed Sep 13, 2022
1 parent 5982a67 commit 1773605
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/bep/turbo/v7

go 1.19
5 changes: 5 additions & 0 deletions src/core/drive/visit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,5 +407,10 @@ export class Visit implements FetchRequestDelegate {
}

function isSuccessful(statusCode: number) {
if (statusCode == 404) {
// Temporary patch (bep).
// In most cases, a 404 response is, from a rendering perspective, a successful response.
return true
}
return statusCode >= 200 && statusCode < 300
}

0 comments on commit 1773605

Please sign in to comment.