SinTan1729 / chhoto-url

A simple, blazingly fast, selfhosted URL shortener with no unnecessary features; written in Rust.
https://hub.docker.com/r/sintan1729/chhoto-url
MIT License
142 stars 15 forks source link

It is possible to create short links with '/' in them which cannot be deleted #6

Closed smstroble closed 8 months ago

smstroble commented 8 months ago

Describe the bug It is possible to create short links with '/' in them which cannot be deleted

To Reproduce Steps to reproduce the behavior:

  1. Go to 'http://localhost:4567'
  2. Enter any long URL
  3. Enter short url 'some/path'
  4. Click 'Shorten!'
  5. Attempt to delete the newly created URL
  6. Attempt to navigate to 'http://localhost:4567/some/path'

Expected behavior Any short URL created should be deletable. Editing the REST call to replace '/' with '%2F' works to delete it.

Possible solutions:

Supporting

Desktop (please complete the following information):

SinTan1729 commented 8 months ago

Thank you for the bug report. I decided to go with blocking such URLs. This was already supposed to be the case but I goofed up the regex string for checking validity. I just pushed a commit potentially fixing this. Can you check and let me know if this fixed the issue for you?

smstroble commented 8 months ago

Perfect, that worked for me. Thanks!