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

Remove calls to deprecated url.parse #1360

Merged
merged 4 commits into from
Jul 22, 2021
Merged

Remove calls to deprecated url.parse #1360

merged 4 commits into from
Jul 22, 2021

Conversation

acdibble
Copy link
Contributor

Fixes #1357.

url.parse and the legacy Node.js Url object were deprecated in Node 12.

By replacing it with the WHATWG URL API, username and password parsing comes for free. Additionally, uses of the query property had to be changed to use the URLSearchParams object.

@acdibble
Copy link
Contributor Author

@sidorares , I've fixed the parsing and added a new test to validate the behavior. Let me know if there is anything else I can do to help get this merged in.

@sidorares
Copy link
Owner

@acdibble I think your editor config is slightly different to what's used here, can you discard commits unrelated to your main change ( replacing url.parse with URL )? appveyor build fails because of lint errors

@acdibble
Copy link
Contributor Author

@sidorares , I think one of the commit hooks changed some stuff. It seems like my local ESLint is in conflict with Appveyor's:

$ npx eslint .

~/node-mysql2/examples/promise-co-await/co.js
  17:9   error  Unexpected function expression  prefer-arrow-callback
  20:10  error  Unexpected function expression  prefer-arrow-callback

~/node-mysql2/examples/ssl/rds-ssl.js
  14:45  error  Unexpected function expression  prefer-arrow-callback

~/node-mysql2/examples/ssl/select-over-ssl.js
  19:34  error  Unexpected function expression  prefer-arrow-callback
  21:49  error  Unexpected function expression  prefer-arrow-callback

~/node-mysql2/tools/generate-charset-mapping.js
  33:30  error  Unexpected function expression   prefer-arrow-callback
  46:17  error  Unexpected string concatenation  prefer-template

✖ 7 problems (7 errors, 0 warnings)
  7 errors and 0 warnings potentially fixable with the `--fix` option.

I've reverted those changes so hopefully the build is green this time.

@sidorares
Copy link
Owner

thanks @acdibble !

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.

Password, in URL connection string, that contain a colon are not supported
2 participants