Skip to content

net: preserve port 80 in SocketAddress.parse#63058

Closed
cookesan wants to merge 1 commit intonodejs:mainfrom
cookesan:net-socketaddress-default-port
Closed

net: preserve port 80 in SocketAddress.parse#63058
cookesan wants to merge 1 commit intonodejs:mainfrom
cookesan:net-socketaddress-default-port

Conversation

@cookesan
Copy link
Copy Markdown
Contributor

Summary

  • preserve explicit port 80 when parsing net.SocketAddress strings
  • keep the existing HTTP URL parse for canonical IPv4 forms

Fixes: #62906

Testing

  • make JOBS=8
  • ./node --test test/parallel/test-socketaddress.js
  • python3 tools/test.py parallel/test-socketaddress
  • make lint-js
  • git diff --check
  • manual assertion script for IPv4, IPv6, leading-zero port, and numeric IPv4 shorthand cases

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. net Issues and PRs related to the net subsystem. labels Apr 30, 2026
@cookesan cookesan force-pushed the net-socketaddress-default-port branch from 6f34fb4 to 81e1f54 Compare April 30, 2026 21:16
@cookesan
Copy link
Copy Markdown
Contributor Author

Closing this in favor of #62912, which is the earlier PR for the same issue. I missed it when opening this one and left a technical note there about an edge case in the raw port parsing approach.

@cookesan cookesan closed this Apr 30, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.64%. Comparing base (80e0f14) to head (81e1f54).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #63058      +/-   ##
==========================================
- Coverage   89.65%   89.64%   -0.01%     
==========================================
  Files         708      708              
  Lines      220413   220423      +10     
  Branches    42275    42276       +1     
==========================================
- Hits       197607   197600       -7     
- Misses      14658    14659       +1     
- Partials     8148     8164      +16     
Files with missing lines Coverage Δ
lib/internal/socketaddress.js 99.03% <100.00%> (+0.04%) ⬆️

... and 31 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. net Issues and PRs related to the net subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SocketAddress parses port 80 as 0

2 participants