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

Support for urls without http/s #160

Closed
wants to merge 2 commits into from

Conversation

SurajJadhav7
Copy link

@SurajJadhav7 SurajJadhav7 commented Nov 19, 2020

Fixed #155

User will be able to add urls without url scheme (http/s).
Support for urls with ftp, mailto, telnet is not added yet.

validate_code = validate_url.status_code
if url.startswith(("http://", "https://")):
validate_code = requests.get(url).status_code
elif requests.get("http://" + url).status_code == 200:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Above 2 line code is sufficient. Don't need this.

validate_code = validate_url.status_code
if url.startswith(("http://", "https://")):
validate_code = requests.get(url).status_code
elif requests.get("http://" + url).status_code == 200:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

validate_code = validate_url.status_code
if url.startswith(("http://", "https://")):
validate_code = requests.get(url).status_code
elif requests.get("http://" + url).status_code == 200:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proper URL validation needed.
3 participants