Closed Srikar04 closed 1 month ago
@Srikar04 is attempting to deploy a commit to the Abhijeet's projects Team on Vercel.
A member of the Team first needs to authorize it.
Hey @Srikar04, I have approved this PR although it has more latency but it is also more robust solution.
Hey @Srikar04, i have merged this PR. Star this repo to support our project and share with your network.
Thanks for contributing.
Fixes: #137
Description: This pull request addresses the issue where the URL validation logic in the isValidURL middleware incorrectly considers URLs as valid even when the HTTP status code is not 200. The fix modifies the checkWebsite function to properly handle status codes other than 200, ensuring accurate URL validation by defining a set of Valid URL's and a retry mechanism upto 3 times
Tests: Conducted manual testing to ensure that URLs with non-200 status codes are correctly identified as invalid by the isValidURL middleware.
Test 1: Input url: https://www.linkedin.com/in/srikarmellachervu/ Status Code: 999 Output:![sol](https://github.com/abhijeetnishal/URLShortener/assets/101891231/8bb1d483-9742-419e-97ac-7bd9a5bf34a9)
Test 2: Input url: https://redis.io/docs/latest/develop/use/ Status code: 200 Output:![sol](https://github.com/abhijeetnishal/URLShortener/assets/101891231/a0ddd0ef-ef9b-4b52-92e1-0aa0505cd5fa)