-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add Url capability: parsing/validating url strings #1903
Comments
For now I'm just working around this on my end by doing:
but obviously this doesn't address the "bogus" case. |
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks. |
Currently the I am not sure if the |
can i work on this @edenman , @victorcwai ? |
@e5l team, please review the PR when you get a chance. |
This reverts commit f05b591.
This also got me. Its extremely unexpected to have a relative url get parsed as |
Would it make sense to return a |
@e5l if this is still needed, I'll give it a try this week. |
@ablx, thanks! it would be great |
Sure! Let me check |
Merged |
Subsystem
ktor-http
Is your feature request related to a problem? Please describe.
My app gives me unexpected results on
Url(String)
Describe the solution you'd like
Url should have a factory method that returns an optional Url, something like:
This method should return null if the url is not valid. It should not throw exceptions.
Motivation to include to ktor
User-submitted content often has urls in it and it would be useful to validate them and extract the various url parts.
Specific urls that are currently broken:
Url("bogus").toString()
returnshttp://localhost/bogus
and I think it should return null from this new method.Url("http://localhost:7000Pragma").toString()
throws an exception and I think it should return null from this new method.The text was updated successfully, but these errors were encountered: