net: reject non-address SocketAddress.parse input - #64832
Conversation
|
Review requested:
|
There was a problem hiding this comment.
This would make the port issue much simpler with this additional validation. If the string ends in /:(\d+)$/, then it can just be sliced off, and if the rest of the string gets parsed as a valid hostname by URLParse then the port can be obtained from the digit string with NumberParseInt.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #64832 +/- ##
==========================================
- Coverage 91.85% 90.10% -1.75%
==========================================
Files 400 753 +353
Lines 179110 252400 +73290
Branches 27346 47481 +20135
==========================================
+ Hits 164516 227418 +62902
- Misses 14264 16271 +2007
- Partials 330 8711 +8381
🚀 New features to boost your workflow:
|
|
@Renegade334 maybe we should include |
|
I'm not yet convinced this is the best way to approach this (with the regex). Won't block for now but there's probably a more performant / reliable way. |
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
971d5b4 to
9d21a93
Compare
@jasnell I implemented a new strict socket address parser replacing Ada, it fixes #62906 and is faster. Benchmark results compared to main: |
No description provided.