New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

webmention-handler

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webmention-handler - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

.github/workflows/release.yml

13

dist/index.js

@@ -229,13 +229,16 @@ 'use strict';

const { html, status, error } = await fetchHtml(mention.source);
// Delete exisiting webmentions with the current source and target to avoid duplication
await this.storageHandler.deleteMention(mention);
// A status of 410 indicates that the webmention that previously existed was deleted
// If we got an error or there was no html body, then the source is invalid and
// we should delete any stored version of the webmention as per the specification
// we should delete any stored version of the webmention as per the specification without
// adding new ones
if (error || !html || status === 410)
return this.storageHandler.deleteMention(mention);
return null;
const hEntries = parseHtml(html, mention.source, mention.target);
let mentionedUrls = hEntries.find(({ type }) => type && type.includes("mention-of"));
// If the page does not include any mention of the target, then delete any previously
// acknowledged mentions and retun null;
// If the page does not include any mention of the target, then we can return
// early as we have already deleted any stored mentions with this target and source
if (!mentionedUrls)
return this.storageHandler.deleteMention(mention);
return null;
let mentions = hEntries.map(h => convertHEntryToMention(h, mention.source, mention.target));

@@ -242,0 +245,0 @@ if (mentions.length > 1)

{
"name": "webmention-handler",
"version": "0.0.4",
"version": "0.0.5",
"description": "A handler for web mentions",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc