silverbulletmd / silverbullet

The hackable notebook
https://silverbullet.md
MIT License
2.03k stars 140 forks source link

Fix space on end of page name creates two pages, one shadowed #615 #817

Closed fflorent closed 3 months ago

fflorent commented 3 months ago

Context

Fixes #615.

Proposed solution

  1. Disallow PUT on filename with filenames surrounded with spaces;
  2. If the filename provided on GET is surrounded by spaces, redirect to its trimmed version;
  3. In case of required authentication, return a 401 (UNAUTHORIZED) + redirect;

Other

If you want me to create tests, I would like to know if there already exists files places I can put them in.

zefhemel commented 3 months ago

Sorry for the delay, this looks good. Thanks!