The problem was that even when the username isn't found on the HackerEarth site the status code the website returns is 200. I found a way to identify the 404 page by changing the axios request to a 'get' instead of a 'head' - in order to get the data response - and looking within that data for a '404 error' element.
Types of changes
Put an x in the boxes that apply
[x] Bugfix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
Issue that this pull request solves
Closes: #2
Proposed changes
The problem was that even when the username isn't found on the HackerEarth site the status code the website returns is 200. I found a way to identify the 404 page by changing the axios request to a 'get' instead of a 'head' - in order to get the data response - and looking within that data for a '404 error' element.
Types of changes
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that applyScreenshots
Please attach the screenshots of the changes made in case of change in user interface
Other information
Any other information that is important to this pull request