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

Do some sanity checks before shortlink is created #4

Open
roelvangils opened this issue May 8, 2024 · 0 comments
Open

Do some sanity checks before shortlink is created #4

roelvangils opened this issue May 8, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@roelvangils
Copy link
Member

roelvangils commented May 8, 2024

As a user who can make mistakes (as all users do), we want the shortlinker to be smart about it and warn the user when they're trying to create a shortlink that won't work for one of these obvious reasons:

  1. When the URL returns a status code of 404 (such as https://evelinewaays.be/).
  2. When the URL returns a status code of 302. In such cases, the shortlinker should follow through (perhaps there are multiple redirects) until it reaches a page that returns a 200 status code. That's the URL that needs to be saved to the database. However, if the URL contains strings like account or signin, this signifies that the user has tried to save a shortlink for a web page that cannot be shared. In such instances, we should display a warning.

Potential other checks

Maybe there are other sanity checks we could consider. ChatGPT suggested the following:

  • Potential Security risks: Check for URLs leading to websites known for phishing or malware distribution, perhaps by comparing the URL against a regularly updated threat database.
  • Repeated Shortening: If a user is attempting to shorten a URL that has been shortened already, the service might just retrieve the previously created shortlink rather than creating a new one.
@roelvangils roelvangils added the enhancement New feature or request label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants