URL Shortener: failing the last test, even though visually all looks just fine

Tell us what’s happening:


I can’t figure out what is the issue here, I tested my code many times with different options and it all seems to be working as described in the assignment, but fails the last test when I try to submit my work.

Could you please look into my live project or/and source code to point me in the right direction?

Thank you in advance!

Your project link(s)

code: https://replit.com/@konstantinik1/url-shortener

live project: https://url-shortener.konstantinik1.repl.co/

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36

Challenge: URL Shortener Microservice

Link to the challenge:

with what kind of invalid url are you testing to check if everything works?

I tried the following:

and what if you have something like ftp://google.com?

This one got saved into the database without error. Is it supposed to only accept http and https addresses?

I changed the logic to throw an error in case if the string with URL doesn’t start with ‘http’ or ‘https’ and my app passed the tests. Thank you!