kevinanielsen / go-fast-cdn

A fast and easy-to-use CDN, built with Go.
https://kevinanielsen.github.io/go-fast-cdn/
MIT License
107 stars 23 forks source link

fix: adding file name validation before adding file to database #103

Closed Caixetadev closed 5 months ago

Caixetadev commented 5 months ago

This pull request fixes an error that even if util.FilterFilename return an error, the application writes it to the database

Follow the flow to reproduce the error

  1. upload file with name Arquitetura Limpa - O Guia do Artesão para Estrutura e Design de Software (Robert C. Martin) (Z-Library).pdf guive an error image

  2. But even so, it still registers in the database image

  3. If I try to delete it, an error occurs. image

  4. However, even with the error, it still gets deleted from the database (requires refreshing the page).image

With the current state of this pull request, the issue is resolved. However, we need to investigate why the util.FilterFilename function returned an error for the file name. If necessary, we may have to make modifications to the util.FilterFilename function. Additionally, we need to look into why step 3 returned an error when I clicked delete. Nonetheless, in step 4, after refreshing the page, the data was deleted from the database despite the error.