Add support for configs
This commit is contained in:
@@ -27,10 +27,11 @@ func HandleGetRequest(w http.ResponseWriter, r *http.Request, t *torrent.Torrent
|
||||
}
|
||||
|
||||
// Get the last two segments
|
||||
baseDirectory := segments[len(segments)-3]
|
||||
torrentName := segments[len(segments)-2]
|
||||
filename := segments[len(segments)-1]
|
||||
|
||||
torrents := findAllTorrentsWithName(t, torrentName)
|
||||
torrents := findAllTorrentsWithName(t, baseDirectory, torrentName)
|
||||
if torrents == nil {
|
||||
log.Println("Cannot find torrent", torrentName)
|
||||
http.Error(w, "Cannot find file", http.StatusNotFound)
|
||||
|
||||
Reference in New Issue
Block a user