Skip to content

Commit

Permalink
Fix redirects to match what is returned in the online store (#946)
Browse files Browse the repository at this point in the history
  • Loading branch information
blittle committed May 25, 2023
1 parent 487c7b9 commit 4c5cdfd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/calm-pears-lick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/hydrogen': patch
---

Fix redirects to respond with a 301
2 changes: 1 addition & 1 deletion packages/hydrogen/src/routing/redirect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export async function storefrontRedirect(
const location = urlRedirects?.edges?.[0]?.node?.target;

if (location) {
return new Response(null, {status: 302, headers: {location}});
return new Response(null, {status: 301, headers: {location}});
}

const searchParams = new URLSearchParams(search);
Expand Down

0 comments on commit 4c5cdfd

Please sign in to comment.