@chrisburnell/eleventy-cache-webmentions 2.1.4 → 2.1.5

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.
@@ -162,9 +162,13 @@ const performFetch = async (options, webmentions, url) => {
162
162
  // Process the blocklist, if it has any entries
163
163
  if (options.blocklist.length) {
164
164
  webmentions = webmentions.filter((webmention) => {
165
- let sourceUrl = getSource(webmention);
166
- for (let url of options.blocklist) {
167
- if (sourceUrl.includes(url.replace(/\/?$/, "/"))) {
165
+ let url = getSource(webmention);
166
+ let source = getSource(webmention);
167
+ for (let blocklistURL of options.blocklist) {
168
+ if (
169
+ url.includes(blocklistURL.replace(/\/?$/, "/")) ||
170
+ source.includes(blocklistURL.replace(/\/?$/, "/"))
171
+ ) {
168
172
  return false;
169
173
  }
170
174
  }
@@ -174,9 +178,13 @@ const performFetch = async (options, webmentions, url) => {
174
178
  // Process the allowlist, if it has any entries
175
179
  if (options.allowlist.length) {
176
180
  webmentions = webmentions.filter((webmention) => {
177
- let sourceUrl = getSource(webmention);
178
- for (let url of options.allowlist) {
179
- if (sourceUrl.includes(url.replace(/\/?$/, "/"))) {
181
+ let url = getSource(webmention);
182
+ let source = getSource(webmention);
183
+ for (let allowlistURL of options.allowlist) {
184
+ if (
185
+ url.includes(allowlistURL.replace(/\/?$/, "/")) ||
186
+ source.includes(allowlistURL.replace(/\/?$/, "/"))
187
+ ) {
180
188
  return true;
181
189
  }
182
190
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrisburnell/eleventy-cache-webmentions",
3
- "version": "2.1.4",
3
+ "version": "2.1.5",
4
4
  "description": "Cache webmentions using eleventy-fetch and make them available to use in collections, layouts, pages, etc. in Eleventy.",
5
5
  "license": "MIT",
6
6
  "repository": {