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

Changes related to issue #79 deadlinks #80

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

shaikfareed46
Copy link

No description provided.

Copy link
Collaborator

@nicolas-raoul nicolas-raoul left a comment

Choose a reason for hiding this comment

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

Thanks! :-)

poi.add(ValidationIssue.INVALID_URL);
}
}
}

private boolean validWebsiteURL(String urlString) {
public boolean urlExists(String urlString) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you please add this:

if (urlString.contains("{{dead link")) {
    return false;
}

Thanks! :-)

Copy link
Author

Choose a reason for hiding this comment

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

Changes made

@nicolas-raoul
Copy link
Collaborator

Also, broken URL should be thrown away and not put into the output data. This can be a different pull request.

@shaikfareed46
Copy link
Author

Well anyways removing broken URL is been already handled previously i guess. I dint find it in any other place

@Test
public void testURLExistPositive(){
WebsiteURLValidator websiteURLValidator = new WebsiteURLValidator();
assertTrue(websiteURLValidator.urlExists("www.google.com"));
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should require a protocol (for instance https://) no?

url = new URL(urlString);

// We want to check the current URL
HttpURLConnection.setFollowRedirects(false);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Indentation seems to be inconsistent.

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

Successfully merging this pull request may close these issues.

2 participants