@stackfactor/client-api 1.1.78 → 1.1.79

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.
Files changed (2) hide show
  1. package/lib/integration.js +12 -11
  2. package/package.json +1 -1
@@ -171,16 +171,16 @@ export const getContentInformationByUrlFromBrowser = (url) => {
171
171
  baseURL: domain.origin,
172
172
  });
173
173
  let confirmationRequest = instance.get(domain.pathname, {
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
- // },
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 title = document.querySelector("title")?.rawText;
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackfactor/client-api",
3
- "version": "1.1.78",
3
+ "version": "1.1.79",
4
4
  "description": "Node.js library for the StackFactor API",
5
5
  "main": "index.js",
6
6
  "exports": {