mysqljs / mysql

A pure node.js JavaScript Client implementing the MySQL protocol.
MIT License
18.22k stars 2.53k forks source link

Updating URL parsing to WHATWG URL #2563

Open dresende opened 7 months ago

dresende commented 7 months ago

@dougwilson I think we should update connection configuration URL parsing to use the new method as the previous is deprecated and I see some issues open about it (#2561), as well as myself hitting this problem with a more complex URL that url.parse is unable to process.

I can do this change right now but if we're going to do this, we should also increase the minimum node version that people can use with this module. What are your thoughts about it?

dougwilson commented 7 months ago

Oh, interesting. I mean, we could maybe use both, with the WHATWG when available, otherwise the old. What is the URL that you are having trouble with, BTW? Usually it is not very complex for this module, as there isn't a lot to it.

dresende commented 7 months ago

Ok, I will make a pull request supporting both. The URL has a password with a % on it. At first I tried to escape it, with no success using url.parse. The used the new URL approach and didn't even need to escape it. Just works.