EDIT: The fix for this is probably to do whatever happens when making an invalid request to /torrent/invalidTorrent and output the following:
{"message":"Torrent not found."}
SECOND EDIT: I'm new to programming in Golang so I'm not sure how efficient this is but I managed to solve this issue by adding the following to the beggining of of the apiScrape function:
defer func() {
if s := recover(); s != nil {
r.JSON(404, map[string]interface{}{"message": "Torrent not found."})
return
}
}()
This bug is reproducible as follows:
curl http://127.0.0.1:1337/scrape/invalidTorrent
EDIT: The fix for this is probably to do whatever happens when making an invalid request to /torrent/invalidTorrent and output the following:
{"message":"Torrent not found."}
SECOND EDIT: I'm new to programming in Golang so I'm not sure how efficient this is but I managed to solve this issue by adding the following to the beggining of of the apiScrape function: