mysql2 3.24.4 → 3.24.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.
@@ -333,8 +333,11 @@ class ConnectionConfig {
333
333
 
334
334
  static parseUrl(url) {
335
335
  const parsedUrl = new URL(url);
336
+ const { hostname } = parsedUrl;
336
337
  const options = {
337
- host: decodeURIComponent(parsedUrl.hostname),
338
+ host: decodeURIComponent(
339
+ hostname.startsWith('[') ? hostname.slice(1, -1) : hostname
340
+ ),
338
341
  port: parseInt(parsedUrl.port, 10),
339
342
  database: decodeURIComponent(parsedUrl.pathname.slice(1)),
340
343
  user: decodeURIComponent(parsedUrl.username),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mysql2",
3
- "version": "3.24.4",
3
+ "version": "3.24.5",
4
4
  "description": "fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS",
5
5
  "main": "index.js",
6
6
  "typings": "typings/mysql/index",