raftario / filite

A simple, light and standalone pastebin, URL shortener and file-sharing service
MIT License
190 stars 16 forks source link

Using more than 6 letters results in "Error: Invalid ID" #22

Open Zeklyn opened 4 years ago

Zeklyn commented 4 years ago

Hello! If you try to use more than 6 letters in the links/text tab it results in "Error: Invalid ID", do this with files and it'll result in a "Bad gateway 502" error. URLs are somehow capped at 6 letters.

Config

database_url = "/home/cdn/.local/share/filite/database.db"
pool_size = 4
files_dir = "/home/cdn/.local/share/filite/files"

[highlight]
theme = "github"
languages = ["rust"]

Logs

(when doing the example below)

[2020-04-16T17:38:55Z INFO  actix_web::middleware::logger] 127.0.0.1:57806 "GET /f HTTP/1.0" 200 684 "https://example.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0" 0.000285
[2020-04-16T17:38:55Z INFO  actix_web::middleware::logger] [::1]:35722 "GET /l HTTP/1.0" 200 225 "https://example.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0" 0.000264
[2020-04-16T17:38:55Z INFO  actix_web::middleware::logger] 127.0.0.1:57810 "GET /t HTTP/1.0" 200 335 "https://example.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0" 0.000219
[2020-04-16T17:39:14Z INFO  actix_web::middleware::logger] [::1]:35726 "PUT /f/4578329478932743982 HTTP/1.0" 400 10 "https://example.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0" 0.000080
[2020-04-16T17:39:14Z INFO  actix_web::middleware::logger] 127.0.0.1:57814 "PUT /f/4578329478932743982 HTTP/1.0" 400 10 "https://example.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0" 0.000046

Example

1Xe2zOS

raftario commented 4 years ago

This is normal, as internally IDs are stored as 32 bits integers. However, the web UI should warn you and disable submission if the ID is invalid, which is visibly not happening. I'll look into it.

I also plan to rework most of the internal structure to remove that limitation as soon as I have more time.