open-graph-scraper
Advanced tools
Comparing version 6.0.1 to 6.1.0
# Change Log | ||
## 6.1.0 | ||
- Setting the `origin` `header` to the request url since `fetch` runs in [cors mode by default](https://github.com/nodejs/undici/issues/1305). | ||
- Import `undici` for `fetch` so all versions of node18 are running the same version of `fetch`. Now ogs supports all versions of node18! | ||
- Updating Dependencies | ||
## 6.0.1 | ||
@@ -4,0 +10,0 @@ |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const undici_1 = require("undici"); | ||
/** | ||
@@ -14,3 +15,7 @@ * performs the fetch request and formats the body for ogs | ||
try { | ||
response = await fetch(options.url, { signal: AbortSignal.timeout((options.timeout || 10) * 1000), ...options.fetchOptions }); | ||
response = await (0, undici_1.fetch)(options.url, { | ||
signal: AbortSignal.timeout((options.timeout || 10) * 1000), | ||
headers: { Origin: options.url }, | ||
...options.fetchOptions, | ||
}); | ||
body = await response.text(); | ||
@@ -17,0 +22,0 @@ if (response && response.headers && response.headers.get('content-type') && !response.headers.get('content-type')?.includes('text/')) { |
@@ -0,1 +1,2 @@ | ||
import type { RequestInit } from 'undici'; | ||
/** | ||
@@ -2,0 +3,0 @@ * The options used by Open Graph Scraper |
"use strict"; | ||
/* eslint-disable max-len */ | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
{ | ||
"name": "open-graph-scraper", | ||
"description": "Node.js scraper module for Open Graph and Twitter Card info", | ||
"version": "6.0.1", | ||
"version": "6.1.0", | ||
"license": "MIT", | ||
@@ -20,3 +20,3 @@ "main": "./dist/index.js", | ||
"engines": { | ||
"node": ">=18.16.0" | ||
"node": ">=18.0.0" | ||
}, | ||
@@ -31,2 +31,3 @@ "author": { | ||
"cheerio": "^1.0.0-rc.12", | ||
"undici": "^5.22.1", | ||
"validator": "^13.9.0" | ||
@@ -40,9 +41,9 @@ }, | ||
"devDependencies": { | ||
"@snyk/protect": "^1.1153.0", | ||
"@types/node": "^18.16.6", | ||
"@types/validator": "^13.7.16", | ||
"@typescript-eslint/eslint-plugin": "^5.59.5", | ||
"@typescript-eslint/parser": "^5.59.5", | ||
"@snyk/protect": "^1.1175.0", | ||
"@types/node": "^18.16.16", | ||
"@types/validator": "^13.7.17", | ||
"@typescript-eslint/eslint-plugin": "^5.59.9", | ||
"@typescript-eslint/parser": "^5.59.9", | ||
"chai": "^4.3.7", | ||
"eslint": "^8.40.0", | ||
"eslint": "^8.42.0", | ||
"eslint-config-airbnb-base": "^15.0.0", | ||
@@ -55,7 +56,6 @@ "eslint-config-airbnb-typescript": "^17.0.0", | ||
"nyc": "^15.1.0", | ||
"sinon": "^15.0.4", | ||
"sinon": "^15.1.0", | ||
"ts-mocha": "^10.0.0", | ||
"tunnel": "^0.0.6", | ||
"typescript": "^5.0.4", | ||
"undici": "^5.22.0" | ||
"typescript": "^5.1.3" | ||
}, | ||
@@ -62,0 +62,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
85961
18
2077
0
4
+ Addedundici@^5.22.1
+ Added@fastify/busboy@2.1.1(transitive)
+ Addedundici@5.28.4(transitive)