Skip to content

Commit 361a7aa

Browse files
authored
feat(storage)!: Throw an error for 403 HTTP responses (#212)
1 parent a3c1def commit 361a7aa

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/smooth-scissors-end.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@zarrita/storage": patch
3+
---
4+
5+
`FetchStore` throws an error for 403 (forbidden) responses. This is a **breaking** change because previously `404` and `403` responses were treated the same way. Now, only `404` responses signify a "missing" key from the store.

packages/storage/src/fetch.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function resolve(root: string | URL, path: AbsolutePath): URL {
1616
async function handle_response(
1717
response: Response,
1818
): Promise<Uint8Array | undefined> {
19-
if (response.status === 404 || response.status === 403) {
19+
if (response.status === 404) {
2020
return undefined;
2121
}
2222
if (response.status === 200 || response.status === 206) {

0 commit comments

Comments
 (0)