PROGRADE-Tech / Tarchivebot

:page_with_curl: Telegram chat message archive and statistics
https://tarchive.neat.moe
GNU Affero General Public License v3.0
10 stars 4 forks source link

Server responds with 504 (Gateway timeout) #46

Closed fuerbringer closed 7 years ago

fuerbringer commented 7 years ago

The /api/recent (possibly other too) responds with 504 Gateway Timeout when a null value is passed as demonstrated here:

└─[λ] curl -d '{"key":null,"amount":2}' -H 'Content-Type: application/json' http://localhost:3000/api/recent -v
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 3000 (#0)
> POST /api/recent HTTP/1.1
> Host: localhost:3000
> User-Agent: curl/7.54.1
> Accept: */*
> Content-Type: application/json
> Content-Length: 23
> 
* upload completely sent off: 23 out of 23 bytes

* Empty reply from server
* Connection #0 to host localhost left intact
curl: (52) Empty reply from server

This results in the call waiting for a significant amount of time and eventually hanging up. Desired result would be it just returning immidiately (since no chat ever would have the api key null)