-
Notifications
You must be signed in to change notification settings - Fork 1
Support SSH URLs with port numbers and improve validation #20
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
Conversation
The main changes are: - Update SSH URL regex to handle URLs with port numbers (e.g. ssh://user@host:port/path) - Add support for ~ character in valid repo path pattern - Improve URL format detection efficiency by using string prefix checks - Fix regex group handling for SSH URLs with optional port number - Add test cases for alternative SSH URL formats The commit focuses on improving SSH URL handling while maintaining security validation.
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.
Pull Request Overview
Enhances SSH URL parsing to support port numbers and improves repository URL validation. The changes modernize URL format detection and add comprehensive test coverage for different SSH URL formats.
- Updated SSH URL regex to handle port numbers in
ssh://user@host:port/pathformat - Added support for tilde character in repository path validation
- Improved URL format detection using efficient string prefix checks
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| main.go | Updates SSH regex pattern to support port numbers, improves URL detection logic with prefix checks, and adjusts regex group handling |
| main_test.go | Adds test cases for URL detection function and includes test for domain with port numbers |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
The main changes are:
The commit focuses on improving SSH URL handling while maintaining security validation.