Skip to content

Commit

Permalink
Multibyte product title fix from Shopify/hydrogen#1209
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu-shopify committed Aug 14, 2023
1 parent eec8b22 commit 0c967dd
Show file tree
Hide file tree
Showing 2 changed files with 12,006 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/routes/($locale).products.$productHandle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ function redirectToFirstVariant({product, request}) {
searchParams.set(option.name, option.value);
}

throw redirect(`/products/${product.handle}?${searchParams.toString()}`, 302);
// throw redirect(`/products/${product.handle}?${searchParams.toString()}`, 302);
// Fix from https://github.com/Shopify/hydrogen/issues/1209
// Use URL to avoid accidental double encoding
const newUrl = new URL(`/products/${product.handle}?${searchParams.toString()}`, 'http://example.com');
throw redirect(newUrl.pathname + newUrl.search, 302);
}

export default function Product() {
Expand Down
Loading

0 comments on commit 0c967dd

Please sign in to comment.