From ff5dd2832ba731cdf3af13e6290b15c89f043d17 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Sep 2026 01:19:41 +0000 Subject: [PATCH 1/4] deps: bump js-yaml from 4.3.0 to 5.4.1 Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.3.0 to 5.4.1. - [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md) - [Commits](https://github.com/nodeca/js-yaml/compare/4.3.0...5.4.1) --- updated-dependencies: - dependency-name: js-yaml dependency-version: 5.2.1 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 33 ++++++++++++++++++++++++++++----- package.json | 2 +- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 271afefb8..6646a70cf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "copy-dir": "^1.3.0", "dockerode": "^5.0.1", "glob": "^13.0.0", - "js-yaml": "^4.3.0", + "js-yaml": "^5.4.1", "jsonfile": "^6.2.1", "lodash": "^4.18.1", "node-cache": "^5.1.2", @@ -4467,9 +4467,9 @@ "license": "MIT" }, "node_modules/js-yaml": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz", - "integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.4.1.tgz", + "integrity": "sha512-28R/k+NAjeuf7+CKlTxWZVExJGwVVLwY06DgEnOMz2gEpfNkDcD7QvyiVPT0xy0XXhU8vHsd4Ot42OOPdJG7dQ==", "funding": [ { "type": "github", @@ -4485,7 +4485,7 @@ "argparse": "^2.0.1" }, "bin": { - "js-yaml": "bin/js-yaml.js" + "js-yaml": "bin/js-yaml.mjs" } }, "node_modules/jsdoc-type-pratt-parser": { @@ -5428,6 +5428,29 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/mocha/node_modules/js-yaml": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.2.tgz", + "integrity": "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/mocha/node_modules/lru-cache": { "version": "10.4.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", diff --git a/package.json b/package.json index 1503c431c..f12e8809b 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "copy-dir": "^1.3.0", "dockerode": "^5.0.1", "glob": "^13.0.0", - "js-yaml": "^4.3.0", + "js-yaml": "^5.4.1", "jsonfile": "^6.2.1", "lodash": "^4.18.1", "node-cache": "^5.1.2", From dbcd43f8b205f5d5ed9495ed3703b87a8d66cc43 Mon Sep 17 00:00:00 2001 From: Volodymyr Kolesnykov Date: Tue, 15 Sep 2026 04:41:04 +0300 Subject: [PATCH 2/4] fix: follow js-yaml v5 migration guide --- lib/bootstrap.js | 4 ++-- lib/config.js | 4 ++-- lib/yaml.js | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/bootstrap.js b/lib/bootstrap.js index bcb3720ab..a81f03350 100644 --- a/lib/bootstrap.js +++ b/lib/bootstrap.js @@ -6,7 +6,7 @@ const _ = require('lodash'); const merger = require('./config').merge; const fs = require('fs'); const path = require('path'); -const yaml = require('js-yaml'); +const {load} = require('js-yaml'); /** * Docker and Compose version metadata. @@ -110,7 +110,7 @@ const loadCacheFile = file => { */ const loadLandoFile = file => { try { - return yaml.load(fs.readFileSync(file)); + return load(fs.readFileSync(file, {encoding: 'utf-8'})); } catch (e) { throw new Error(`There was a problem with parsing ${file}. Ensure it is valid YAML! ${e}`, {cause: e}); } diff --git a/lib/config.js b/lib/config.js index 4b98d9dcd..0edfecbee 100644 --- a/lib/config.js +++ b/lib/config.js @@ -6,7 +6,7 @@ const env = require('./env'); const fs = require('fs'); const path = require('path'); const os = require('os'); -const yaml = require('js-yaml'); +const {load} = require('js-yaml'); const url = require('url'); /** @@ -223,7 +223,7 @@ exports.loadFiles = files => _(files) }) // If the file is just a string lets map it to an object .map(source => { - return _.isString(source) ? {file: source, data: yaml.load(fs.readFileSync(source)) || {}} : source; + return _.isString(source) ? {file: source, data: load(fs.readFileSync(source, 'utf-8')) || {}} : source; }) // Add on the root directory for mapping purposes .map(source => _.merge({}, source, {root: path.dirname(source.file)})) diff --git a/lib/yaml.js b/lib/yaml.js index 0ff21e574..2f9437770 100644 --- a/lib/yaml.js +++ b/lib/yaml.js @@ -4,7 +4,7 @@ const fs = require('fs'); const Log = require('./logger'); const path = require('path'); -const yaml = require('js-yaml'); +const {dump, load} = require('js-yaml'); /** * YAML helper for reading and writing config files. @@ -30,7 +30,7 @@ module.exports = class Yaml { */ load(file) { try { - return yaml.load(fs.readFileSync(file)); + return load(fs.readFileSync(file, {encoding: 'utf-8'})); } catch (e) { this.log.error('Problem parsing %s with %s', file, e.message); } @@ -50,7 +50,7 @@ module.exports = class Yaml { // Remove any properties that might be bad and dump data = JSON.parse(JSON.stringify(data)); // And dump - fs.writeFileSync(file, yaml.dump(data)); + fs.writeFileSync(file, dump(data)); // Log and return filename return file; }; From 7781961fbd775ad43dbb4db5b2fb983d5b18a66e Mon Sep 17 00:00:00 2001 From: Volodymyr Kolesnykov Date: Tue, 15 Sep 2026 05:30:39 +0300 Subject: [PATCH 3/4] fix: replace deprecated `url.parse()` --- plugins/lando-proxy/lib/utils.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/plugins/lando-proxy/lib/utils.js b/plugins/lando-proxy/lib/utils.js index f3c3aadc8..c32b53586 100644 --- a/plugins/lando-proxy/lib/utils.js +++ b/plugins/lando-proxy/lib/utils.js @@ -247,16 +247,28 @@ exports.parseUrl = data => { // We add the protocol ourselves, so it can be parsed. We also change all * // occurrences for our magic word __wildcard__, because otherwise the url parser // won't parse wildcards in the hostname correctly. - const parsedUrl = _.isString(data) ? url.parse(`http://${data}`.replace(/\*/g, '__wildcard__')) : _.merge({}, data, { - hostname: data.hostname.replace(/\*/g, '__wildcard__'), - }); + let parsedUrl; + if (typeof data === 'string') { + const u = new URL(`http://${data}`); + parsedUrl = url.urlToHttpOptions(u); + ['port', 'hash', 'search'].forEach(prop => { + parsedUrl[prop] ||= null; + }); + parsedUrl.query = u.searchParams.toString(); + if (parsedUrl.port) { + parsedUrl.port = parsedUrl.port.toString(); + } + parsedUrl.host = u.host; + } else { + parsedUrl = {...data}; + } // If the port is null then set it to 80 if (_.isNil(parsedUrl.port)) parsedUrl.port = '80'; // Retranslate and send const defaults = {port: '80', pathname: '/', middlewares: []}; - return _.merge(defaults, parsedUrl, {host: parsedUrl.hostname.replace(/__wildcard__/g, '*')}); + return _.merge(defaults, parsedUrl, {host: parsedUrl}); }; /** From 459b7adee1a4e3b7744e95940186d90f2fd61f9d Mon Sep 17 00:00:00 2001 From: Volodymyr Kolesnykov Date: Tue, 15 Sep 2026 05:55:22 +0300 Subject: [PATCH 4/4] fix: `urlToHttpOptions` returns a null-proto object --- plugins/lando-proxy/lib/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/lando-proxy/lib/utils.js b/plugins/lando-proxy/lib/utils.js index c32b53586..357d24a01 100644 --- a/plugins/lando-proxy/lib/utils.js +++ b/plugins/lando-proxy/lib/utils.js @@ -250,7 +250,7 @@ exports.parseUrl = data => { let parsedUrl; if (typeof data === 'string') { const u = new URL(`http://${data}`); - parsedUrl = url.urlToHttpOptions(u); + parsedUrl = {...url.urlToHttpOptions(u)}; ['port', 'hash', 'search'].forEach(prop => { parsedUrl[prop] ||= null; });