@ecomplus/storefront-renderer 2.10.6 → 2.10.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.10.7](https://github.com/ecomplus/storefront/compare/@ecomplus/storefront-renderer@2.10.6...@ecomplus/storefront-renderer@2.10.7) (2023-05-20)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **renderer/proxy:** fix handling url on reverse proxy ([#904](https://github.com/ecomplus/storefront/issues/904)) ([15c4116](https://github.com/ecomplus/storefront/commit/15c411617b427fecaa618532d53cff3c245c4ae2))
11
+
6
12
  ## [2.10.6](https://github.com/ecomplus/storefront/compare/@ecomplus/storefront-renderer@2.10.5...@ecomplus/storefront-renderer@2.10.6) (2023-05-12)
7
13
 
8
14
  ### Bug Fixes
@@ -28,16 +28,14 @@ exports.ssr = (req, res, getCacheControl) => {
28
28
  )
29
29
  }
30
30
 
31
- const proxy = url => {
32
- const urlInstance = new URL(url)
33
- const requestUrl = urlInstance.searchParam.get('url')
31
+ const proxy = requestUrl => {
34
32
  if (requestUrl) {
35
- return axios.get(requestUrl, {
33
+ return axios.get(requestUrl, {
36
34
  headers,
37
35
  timeout: 3000,
38
36
  validateStatus: (status) => {
39
37
  return Boolean(status)
40
- }
38
+ }
41
39
  })
42
40
  }
43
41
  return null
@@ -65,7 +63,7 @@ exports.ssr = (req, res, getCacheControl) => {
65
63
 
66
64
  const fallback = () => {
67
65
  if (url.startsWith('/reverse-proxy/')) {
68
- proxy(url).then((response) => {
66
+ proxy(req.query.url).then((response) => {
69
67
  if (response) {
70
68
  const { status, headers, data } = response
71
69
  return res.writeHead(status, headers).send(data)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecomplus/storefront-renderer",
3
- "version": "2.10.6",
3
+ "version": "2.10.7",
4
4
  "description": "SSR for Storefront EJS views with E-Com Plus APIs",
5
5
  "main": "src/index.js",
6
6
  "repository": {