Skip to content

Fix port matching false positive in server discovery#26

Merged
jfox85 merged 1 commit intomainfrom
jf-fix-port-matching
Feb 12, 2026
Merged

Fix port matching false positive in server discovery#26
jfox85 merged 1 commit intomainfrom
jf-fix-port-matching

Conversation

@jfox85
Copy link
Owner

@jfox85 jfox85 commented Feb 12, 2026

Summary

  • Fixes discoverServerName() using strings.Contains(addr, ":80") which would incorrectly match :8080, :8081, etc.
  • Uses strings.HasSuffix instead for exact port matching
  • Adds regression test for the :8080 false positive case

Follow-up to #25 based on CodeRabbit review feedback.

Test plan

  • New test case: :8080 server is not matched, :80 server is correctly selected
  • All existing tests pass

🤖 Generated with Claude Code

Use strings.HasSuffix instead of strings.Contains to prevent ports
like :8080 from being incorrectly matched as the :80 server.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Feb 12, 2026

Warning

Rate limit exceeded

@jfox85 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 16 minutes and 47 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch jf-fix-port-matching

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jfox85 jfox85 merged commit 279108a into main Feb 12, 2026
23 checks passed
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.

1 participant