Conversation
…from recursivezero/develop Develop
…TY-32-260032-handle-invalid-and-valid-url' of https://github.com/recursivezero/tiny into feature/RTY-32-260032-handle-invalid-and-valid-url
|
|
recursivezero
left a comment
There was a problem hiding this comment.
Rename Branch and follow the same syntax as suggsted.
| return False | ||
|
|
||
|
|
||
| # def sanitize_url(url: str) -> str: |
There was a problem hiding this comment.
remove commented code if it is not useful
|
|
||
| if not original_url or not is_valid_url(original_url): | ||
| if not original_url.startswith(("http://", "https://")): | ||
| if re.match(r"^[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+){1,2}$", original_url): |
There was a problem hiding this comment.
this is incorrect approach; create separate method and use that.
There was a problem hiding this comment.
sir if i romve this then if anyone type like https://kdkfjclkdclkd.....it will pass and generate qr ...because it is syntactically valid. ...if u told i will remove it and check only valid urls.
| if not original_url or not is_valid_url(original_url): | ||
| if not original_url.startswith(("http://", "https://")): | ||
| if re.match(r"^[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+){1,2}$", original_url): | ||
| original_url = "https://" + original_url |
There was a problem hiding this comment.
why do you add https by yourself?
There was a problem hiding this comment.
if i don't add this ...then the url like google.com which is valid ,but can't show it as a valid
that's why i add this
Pull Request Template
Description
Fix the issue that valid url is not generated if they have different parameter then global
Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist