Skip to content

Commit ffd27c6

Browse files
committed
ci(core): Request should not throw on 304 status
1 parent 5a97c89 commit ffd27c6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/core/src/shared/request.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@ class FetchRequest {
9999
}
100100

101101
async #throwIfBadResponse(request: RequestParams, response: Response, url: string) {
102-
if (response.ok) {
102+
/**
103+
* response.ok only returns true for 200-299.
104+
* We need to explicitly allow 304 since it means the cached version is still valid
105+
*/
106+
if (response.ok || response.status === 304) {
103107
return
104108
}
105109

0 commit comments

Comments
 (0)