@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 +6 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/image/image.handler.ts +5 -1
package/CHANGELOG.md
CHANGED
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 (
|
|
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 (
|
|
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
|
@@ -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 (
|
|
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
|