Skip to content

Commit 293252d

Browse files
tomoamRich-Harris
andauthored
fix: replace HTTP status code 307 with 303 for redirect (#317)
Co-authored-by: Rich Harris <[email protected]>
1 parent 87c81b2 commit 293252d

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

content/tutorial/04-advanced-sveltekit/03-advanced-routing/04-route-groups/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { redirect } from '@sveltejs/kit';
1616

1717
export function load({ cookies, url }) {
1818
if (!cookies.get('logged_in')) {
19-
throw redirect(307, `/login?redirectTo=${url.pathname}`);
19+
throw redirect(303, `/login?redirectTo=${url.pathname}`);
2020
}
2121
}
2222
```

content/tutorial/04-advanced-sveltekit/03-advanced-routing/04-route-groups/app-a/src/routes/login/+page.server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ import { redirect } from '@sveltejs/kit';
33
export const actions = {
44
default: ({ cookies, url }) => {
55
cookies.set('logged_in', 'true', { path: '/' });
6-
throw redirect(307, url.searchParams.get('redirectTo') ?? '/');
6+
throw redirect(303, url.searchParams.get('redirectTo') ?? '/');
77
}
88
};

content/tutorial/04-advanced-sveltekit/03-advanced-routing/04-route-groups/app-a/src/routes/logout/+page.server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ import { redirect } from '@sveltejs/kit';
33
export const actions = {
44
default: ({ cookies }) => {
55
cookies.delete('logged_in', { path: '/' });
6-
throw redirect(307, '/');
6+
throw redirect(303, '/');
77
}
88
};

content/tutorial/04-advanced-sveltekit/03-advanced-routing/04-route-groups/app-b/src/routes/(authed)/+layout.server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ import { redirect } from '@sveltejs/kit';
22

33
export function load({ cookies, url }) {
44
if (!cookies.get('logged_in')) {
5-
throw redirect(307, `/login?redirectTo=${url.pathname}`);
5+
throw redirect(303, `/login?redirectTo=${url.pathname}`);
66
}
77
}

0 commit comments

Comments
 (0)