Skip to content

Commit

Permalink
fix: return 301 for urlKey lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
dylandepass committed Oct 22, 2024
1 parent 71dc947 commit e0388d5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/catalog/lookup.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ export async function handleProductLookupRequest(ctx, config) {
const sku = await lookupSku(ctx, config, urlkey);
const product = await fetchProduct(ctx, config, sku);
return new Response(JSON.stringify(product), {
headers: { 'Content-Type': 'application/json' },
status: 301,
headers: {
'Content-Type': 'application/json',
Location: `${ctx.url.origin}/${config.org}/${config.site}/${config.env}/${config.storeCode}/${config.storeViewCode}/product/${sku}`,
},
});
}

Expand Down

0 comments on commit e0388d5

Please sign in to comment.