Skip to content
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

tryFixHostUrl 方法的正则表达式疑似错误 #98

Closed
iptton opened this issue Mar 5, 2024 · 1 comment
Closed

tryFixHostUrl 方法的正则表达式疑似错误 #98

iptton opened this issue Mar 5, 2024 · 1 comment

Comments

@iptton
Copy link
Collaborator

iptton commented Mar 5, 2024

fun isUrlWithPath(input: String): Boolean {
            val urlPattern = Regex("^https?://[a-zA-Z0-9-]+(\\\\.[a-zA-Z]{2,})+(/[a-zA-Z0-9-._~:/?#[\\\\]@!\$&'()*+,;=%]*)?\\\$")
            return urlPattern.matches(input)
        }

typo?

"https://example.com/path/to/resource?query=param#fragment" 是通过不了这个正则的,这个方法会在 url 后添加 "/"

@phodal
Copy link
Member

phodal commented Mar 5, 2024

应该是,来 PR?

iptton added a commit to hotip/auto-dev that referenced this issue Mar 8, 2024
@iptton iptton closed this as completed Mar 11, 2024
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

No branches or pull requests

2 participants