@zetagoaurum-socket/wasocket 2.1.9 → 2.2.0
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.
|
@@ -49,7 +49,8 @@ const getUrlInfo = async (text, opts = {
|
|
|
49
49
|
return false;
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
|
-
|
|
52
|
+
},
|
|
53
|
+
// headers: opts.fetchOpts // [FIX] Do not pass fetchOpts as headers, this causes 400 Bad Request
|
|
53
54
|
});
|
|
54
55
|
if (info && 'title' in info && info.title) {
|
|
55
56
|
const [image] = info.images;
|
|
@@ -86,7 +87,9 @@ const getUrlInfo = async (text, opts = {
|
|
|
86
87
|
}
|
|
87
88
|
catch (error) {
|
|
88
89
|
if (!error.message.includes('receive a valid')) {
|
|
89
|
-
|
|
90
|
+
// [FIX] Log error but do not crash/throw for link preview failures
|
|
91
|
+
(_a = opts.logger) === null || _a === void 0 ? void 0 : _a.debug({ err: error.stack, url: text }, 'error in fetching link preview');
|
|
92
|
+
// throw error; // Safe to ignore link preview errors
|
|
90
93
|
}
|
|
91
94
|
}
|
|
92
95
|
};
|