Skip to content

Commit

Permalink
fix: add catalog to redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
maxakuru committed Oct 23, 2024
1 parent 0c59860 commit f41c70e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/catalog/lookup.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export async function handleProductLookupRequest(ctx, config) {
return new Response(undefined, {
status: 301,
headers: {
Location: `${ctx.url.origin}/${config.org}/${config.site}/${config.storeCode}/${config.storeViewCode}/product/${sku}`,
Location: `${ctx.url.origin}/${config.org}/${config.site}/catalog/${config.storeCode}/${config.storeViewCode}/product/${sku}`,
},
});
}
Expand Down
2 changes: 1 addition & 1 deletion test/catalog/lookup.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe('handleProductLookupRequest Tests', () => {

const response = await handleProductLookupRequest(ctx, config);

assert.equal(response.headers.get('Location'), 'https://test-origin/test-org/test-site/test-store-code/test-store-view-code/product/1234');
assert.equal(response.headers.get('Location'), 'https://test-origin/test-org/test-site/catalog/test-store-code/test-store-view-code/product/1234');
assert.equal(response.status, 301);

assert(lookupSkuStub.calledOnceWith(ctx, config, 'some-url-key'));
Expand Down

0 comments on commit f41c70e

Please sign in to comment.