Skip to content

Commit

Permalink
fix(storefront): strf-10193 Bad request for custom front matter:
Browse files Browse the repository at this point in the history
- formatting;
- data from custom layouts is sent as a body but not a header now;
  • Loading branch information
bc-max committed Nov 1, 2022
1 parent 2f6fe39 commit 72cc3de
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
15 changes: 6 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
## [5.3.1](https://github.com/bigcommerce/stencil-cli/compare/5.3.0...5.3.1) (2022-10-28)


### Bug Fixes

* STRF-9781 Bump hapi dependencies ([#930](https://github.com/bigcommerce/stencil-cli/issues/930)) ([05cb607](https://github.com/bigcommerce/stencil-cli/commit/05cb6077497e3fee68578d04f95ab86f0b522c4d))
- STRF-9781 Bump hapi dependencies ([#930](https://github.com/bigcommerce/stencil-cli/issues/930)) ([05cb607](https://github.com/bigcommerce/stencil-cli/commit/05cb6077497e3fee68578d04f95ab86f0b522c4d))

# [5.3.0](https://github.com/bigcommerce/stencil-cli/compare/5.2.5...5.3.0) (2022-10-28)


### Bug Fixes

* **storefront:** bctheme-1284 Fix error on using scoped nested external templates ([#1003](https://github.com/bigcommerce/stencil-cli/issues/1003)) ([1964ff5](https://github.com/bigcommerce/stencil-cli/commit/1964ff58ebebce3a43d79df51b159dbf0b57301d))
* STRF-10157 Added missing dependency ([#1013](https://github.com/bigcommerce/stencil-cli/issues/1013)) ([ebc3bdd](https://github.com/bigcommerce/stencil-cli/commit/ebc3bdd18dfdce066fa92224940d5351c75498e3))
* STRF-10157 Divide docker image release and semantic ([#1012](https://github.com/bigcommerce/stencil-cli/issues/1012)) ([7a2f869](https://github.com/bigcommerce/stencil-cli/commit/7a2f869e59255310dc5dcff06642a56e2cafc3bc))
* update changelog and add tag format w/o 'v' ([#1014](https://github.com/bigcommerce/stencil-cli/issues/1014)) ([26af8fa](https://github.com/bigcommerce/stencil-cli/commit/26af8fadcf47de16f80c1e2560b58857671679cc))

- **storefront:** bctheme-1284 Fix error on using scoped nested external templates ([#1003](https://github.com/bigcommerce/stencil-cli/issues/1003)) ([1964ff5](https://github.com/bigcommerce/stencil-cli/commit/1964ff58ebebce3a43d79df51b159dbf0b57301d))
- STRF-10157 Added missing dependency ([#1013](https://github.com/bigcommerce/stencil-cli/issues/1013)) ([ebc3bdd](https://github.com/bigcommerce/stencil-cli/commit/ebc3bdd18dfdce066fa92224940d5351c75498e3))
- STRF-10157 Divide docker image release and semantic ([#1012](https://github.com/bigcommerce/stencil-cli/issues/1012)) ([7a2f869](https://github.com/bigcommerce/stencil-cli/commit/7a2f869e59255310dc5dcff06642a56e2cafc3bc))
- update changelog and add tag format w/o 'v' ([#1014](https://github.com/bigcommerce/stencil-cli/issues/1014)) ([26af8fa](https://github.com/bigcommerce/stencil-cli/commit/26af8fadcf47de16f80c1e2560b58857671679cc))

### Features

* STRF-10157 Introduce Semantic Release ([#1008](https://github.com/bigcommerce/stencil-cli/issues/1008)) ([085684d](https://github.com/bigcommerce/stencil-cli/commit/085684dae7afef55b1681f6bf3236777fde1df4d))
- STRF-10157 Introduce Semantic Release ([#1008](https://github.com/bigcommerce/stencil-cli/issues/1008)) ([085684d](https://github.com/bigcommerce/stencil-cli/commit/085684dae7afef55b1681f6bf3236777fde1df4d))

### 5.2.5 (2022-10-18)

Expand Down
5 changes: 2 additions & 3 deletions server/plugins/renderer/renderer.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ internals.getResponse = async (request) => {
withoutPageQuery.searchParams.delete('page');

const { customLayouts } = internals.options;
const layouts = customLayouts || DEFAULT_CUSTOM_LAYOUTS_CONFIG;

const httpOpts = {
url: withoutPageQuery.toString(),
Expand All @@ -89,7 +90,7 @@ internals.getResponse = async (request) => {
extraHeaders: { host: storeUrlObj.host, stencil_custom_templates: customLayouts },
}),
accessToken: internals.options.accessToken,
data: request.payload,
data: { ...request.payload, customLayouts: layouts },
method: request.method,
maxRedirects: 0, // handle the redirects manually to handle the redirect location
// If the response is an image it will be parsed wrongly, so we receive a raw data (stream)
Expand Down Expand Up @@ -119,7 +120,6 @@ internals.getResponse = async (request) => {
// clear when making a non-get request because smth may be changed
cache.clear();
}

const response = await networkUtils.sendApiRequest(httpOpts);

internals.processResHeaders(response.headers);
Expand Down Expand Up @@ -156,7 +156,6 @@ internals.getResponse = async (request) => {
* @param request
* @param response
* @param responseArgs
* @param customLayouts
* @returns {*}
*/
internals.parseResponse = async (bcAppData, request, response, responseArgs) => {
Expand Down

0 comments on commit 72cc3de

Please sign in to comment.