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

Add client-side data validation #20

Open
Perry-Bright opened this issue Oct 12, 2024 · 5 comments
Open

Add client-side data validation #20

Perry-Bright opened this issue Oct 12, 2024 · 5 comments

Comments

@Perry-Bright
Copy link

Data validation on the client-side to prevent inconsistent or invalid data being stored

@Perry-Bright
Copy link
Author

It could also handle duplicate entries

@mohtasheem135
Copy link

Handling duplicate data is very much possible and we can achieve it but how to make sure that the added data is valid or not.

@Perry-Bright
Copy link
Author

we can use the fetch API to make a HEAD request to the link. If the response is OK (200-299), we consider the link valid. If the response is not OK, or if there's an error making the request, we consider the link invalid.

but this implementation has some limitations:

  • It may not work for links that require authentication or have other restrictions.
  • It may not work for links that are temporarily unavailable or blocked by the user's network.
  • It may not work for links that have redirects or other complex behaviors.

after more research, we can solve this issues using more complex crawling algorithms that use a combination of techniques like

  • Checking if the link is a valid URL
  • Checking if the link is a known bad URL (e.g. a phishing site)
  • Making a HEAD request to the link to check if it's reachable
  • Checking if the link has a valid SSL certificate
  • Checking if the link has a valid DNS record
  • Checking if the link has a valid HTML structure

@mohtasheem135
Copy link

Cool, I think it can be done.

@Perry-Bright
Copy link
Author

I appreciate your positive attitude and approach to challenging tasks. It's great working with you, @mohtasheem135

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