@websolutespa/bom-mixer-image 1.8.1 → 1.8.2

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
@@ -1,5 +1,11 @@
1
1
  # @websolutespa/bom-mixer-image
2
2
 
3
+ ## 1.8.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Modified: imageHandler
8
+
3
9
  ## 1.8.1
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -108,7 +108,7 @@ function imageHandler({
108
108
  const { headers } = request;
109
109
  const referer = headers.referer;
110
110
  const publicUrl = process.env.NEXT_PUBLIC_URL || "";
111
- if (!referer || !publicUrl || referer.indexOf(publicUrl) !== 0) {
111
+ if (referer && publicUrl !== "https://" && referer.indexOf(publicUrl) !== 0) {
112
112
  return response.status(401).send("you are not authorized to perform this action");
113
113
  }
114
114
  if (url.indexOf("http") === -1 && isVercel()) {
package/dist/index.mjs CHANGED
@@ -72,7 +72,7 @@ function imageHandler({
72
72
  const { headers } = request;
73
73
  const referer = headers.referer;
74
74
  const publicUrl = process.env.NEXT_PUBLIC_URL || "";
75
- if (!referer || !publicUrl || referer.indexOf(publicUrl) !== 0) {
75
+ if (referer && publicUrl !== "https://" && referer.indexOf(publicUrl) !== 0) {
76
76
  return response.status(401).send("you are not authorized to perform this action");
77
77
  }
78
78
  if (url.indexOf("http") === -1 && isVercel()) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@websolutespa/bom-mixer-image",
3
- "version": "1.8.1",
3
+ "version": "1.8.2",
4
4
  "description": "Mixer Image module of the BOM Repository",
5
5
  "keywords": [
6
6
  "bom",
@@ -84,7 +84,11 @@ export function imageHandler({
84
84
  const referer = headers.referer;
85
85
  const publicUrl = process.env.NEXT_PUBLIC_URL || '';
86
86
  // console.log('referef', referer, 'publicUrl', publicUrl);
87
- if (!referer || !publicUrl || referer.indexOf(publicUrl) !== 0) {
87
+ if (
88
+ referer &&
89
+ publicUrl !== 'https://' &&
90
+ referer.indexOf(publicUrl) !== 0
91
+ ) {
88
92
  return response.status(401).send('you are not authorized to perform this action');
89
93
  }
90
94
  // Temporarily fix Vercel local image issue