@stackfactor/client-api 1.1.78 → 1.1.80
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/lib/integration.js +12 -11
- package/lib/utils.js +1 -1
- package/package.json +1 -1
package/lib/integration.js
CHANGED
|
@@ -171,16 +171,16 @@ export const getContentInformationByUrlFromBrowser = (url) => {
|
|
|
171
171
|
baseURL: domain.origin,
|
|
172
172
|
});
|
|
173
173
|
let confirmationRequest = instance.get(domain.pathname, {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
174
|
+
headers: {
|
|
175
|
+
"Access-Control-Allow-Origin": "*",
|
|
176
|
+
"Access-Control-Allow-Headers":
|
|
177
|
+
"Authorization, Origin, X-Requested-With, Content-Type, Accept",
|
|
178
|
+
"Accept":
|
|
179
|
+
"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
|
180
|
+
"Accept-Encoding": "gzip, deflate, br",
|
|
181
|
+
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE",
|
|
182
|
+
"User-Agent": "Mozilla/5.0",
|
|
183
|
+
},
|
|
184
184
|
});
|
|
185
185
|
confirmationRequest
|
|
186
186
|
.then((response) => {
|
|
@@ -193,7 +193,8 @@ export const getContentInformationByUrlFromBrowser = (url) => {
|
|
|
193
193
|
|
|
194
194
|
let document = htmlParser.parse(response.responseText);
|
|
195
195
|
let duration = getReadingTime(htmlToText(response.responseText));
|
|
196
|
-
let
|
|
196
|
+
let titleTag = document.querySelector("title");
|
|
197
|
+
let title = titleTag ? titleTag.rawText : "";
|
|
197
198
|
let description = "";
|
|
198
199
|
const descriptionEl = document.querySelector("meta");
|
|
199
200
|
try {
|
package/lib/utils.js
CHANGED