Skip to content

update httpsnippet to v3.0.1 to allow node v20 #98

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

noghartt
Copy link

@noghartt noghartt commented Jan 16, 2024

related to this issue #99

@MaximeCheramy
Copy link

I'm surprised that this would work. I use this patch on one of my projects:

diff --git a/node_modules/openapi-snippet/index.js b/node_modules/openapi-snippet/index.js
index ea07bdf..b71ab0b 100644
--- a/node_modules/openapi-snippet/index.js
+++ b/node_modules/openapi-snippet/index.js
@@ -9,7 +9,7 @@
 'use strict';

 const OpenAPIToHar = require('./openapi-to-har.js');
-const HTTPSnippet = require('httpsnippet');
+const { HTTPSnippet, availableTargets } = require('httpsnippet');

 /**
  * Return snippets for endpoint identified using path and method in the given
@@ -147,7 +147,7 @@ const formatTarget = function (targetStr) {
   const title = capitalizeFirstLetter(language);
   let library = targetStr.split('_')[1];

-  const validTargets = HTTPSnippet.availableTargets();
+  const validTargets = availableTargets();
   let validLanguage = false;
   let validLibrary = false;
   for (let i in validTargets) {

@julian-alarcon
Copy link

julian-alarcon commented Mar 5, 2025

⚠️ ⚠️ ⚠️
This also solves a High level vulnerability in ansi-regex 2.1.1 is used by httpsnippet
https://security.snyk.io/package/npm/ansi-regex/2.1.1

Regular Expression Denial of Service (ReDoS)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants