Skip to content
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

--nonet option should be optional for users #22

Open
wjhurley opened this issue Sep 7, 2023 · 0 comments
Open

--nonet option should be optional for users #22

wjhurley opened this issue Sep 7, 2023 · 0 comments

Comments

@wjhurley
Copy link

wjhurley commented Sep 7, 2023

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Users should be allowed to decide whether or not to use the internet to fetch DTDs and entities (--nonet option). In my diff below I have just removed the option entirely, but it would be nice to allow a boolean or configuration object to add or remove this option (and possibly other options).

Here is the diff that solved my problem:

diff --git a/node_modules/validate-with-xmllint/lib/index.js b/node_modules/validate-with-xmllint/lib/index.js
index ef67514..fc04770 100644
--- a/node_modules/validate-with-xmllint/lib/index.js
+++ b/node_modules/validate-with-xmllint/lib/index.js
@@ -31,19 +31,19 @@ const exec_xmllint = (input, command) => new Promise((resolve, reject) => {
  *
  * @param input XML
  */
-const validateXML = (input) => exec_xmllint(input, "xmllint --noout --nonet -");
+const validateXML = (input) => exec_xmllint(input, "xmllint --noout -");
 exports.validateXML = validateXML;
 /**
  * Validate XML with DTD.
  *
  * @param input XML
  */
-const validateXMLWithDTD = (input) => exec_xmllint(input, "xmllint --valid --noout --nonet -");
+const validateXMLWithDTD = (input) => exec_xmllint(input, "xmllint --valid --noout -");
 exports.validateXMLWithDTD = validateXMLWithDTD;
 /**
  * Validate XML with the provided XML schema file.
  * @param input XML
  * @param xsdfile Path to XSD
  */
-const validateXMLWithXSD = (input, xsdfile) => exec_xmllint(input, `xmllint --schema ${xsdfile} --noout --nonet -`);
+const validateXMLWithXSD = (input, xsdfile) => exec_xmllint(input, `xmllint --schema ${xsdfile} --noout -`);
 exports.validateXMLWithXSD = validateXMLWithXSD;

This issue body was partially generated by patch-package.

@wjhurley wjhurley changed the title --nonet option should not be forced on users --nonet option should be optional for users Sep 7, 2023
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

No branches or pull requests

1 participant