mkaczanowski / pastebin

Simple, fast, standalone pastebin service
MIT License
155 stars 27 forks source link

[Bug] Generated URLs always return 404 if TTL is specified through CLI arg #7

Closed acherunilam closed 3 years ago

acherunilam commented 3 years ago

Steps to reproduce issue:

$ cargo run -- --ttl 3600
$ echo "hello World" | curl -w '\n' -q -L --data-binary @- -o - http://localhost:8000
# the URL this returns always gives a 404

Looks like a bug?

mkaczanowski commented 3 years ago

looks like a bug:

$ echo "hello World" | curl -w '\n' -q -L --data-binary @- -o - http://localhost:8000
http://localhost:8000/o0VzpmpX7O9WpEMxpwim1 <- not found

$ echo "hello World" | curl -w '\n' -q -L --data-binary @- -o - "http://localhost:8000/?ttl=300"
http://localhost:8000/YWBzMLFUOUjgD73Pnp40v <- good ttl

I'll fix that, thanks!

mkaczanowski commented 3 years ago

It seems the structopt lib had some issue with the u64. I have updated the deps and now it works fine