-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Use the URL global instead of the deprecated url.parse #18657
Conversation
The Node.js url.parse API (https://nodejs.org/api/url.html#urlparseurlstring-parsequerystring-slashesdenotehost) is deprecated because it's prone to security issues (to the point that Node.js doesn't even publish CVEs for it anymore). The official reccomendation is to instead use the global URL constructor, available both in Node.js and in browsers. Node.js filesystem APIs accept URL objects as parameter, so this also avoids a few URL->filepath conversions.
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/90765a0c7e04776/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/aed1bcba6b4767d/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/90765a0c7e04776/output.txt Total script time: 30.39 mins
Image differences available at: http://54.241.84.105:8877/90765a0c7e04776/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/aed1bcba6b4767d/output.txt Total script time: 45.88 mins
Image differences available at: http://54.193.163.58:8877/aed1bcba6b4767d/reftest-analyzer.html#web=eq.log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The src/
-part seems OK to me, but I'd like Tim to look at the test/
-changes since he's touched that code (somewhat) recently and definitely knows it better.
This looks like a nice improvement to me too, and I have tested this locally as well to make sure the behavior didn't change. Overall I think this is simpler and better. Thanks! |
As a side effect, this patch also fixed: |
The changes in
test/webserver.mjs
are mostly because I needed to pass the URL to the hooks, and then at that point decided to just use it everywhere in the file instead of keeping the regexp-based parsing to get the filepath and query params.