fixes here and there
This commit is contained in:
@@ -33,7 +33,7 @@ func HandlePropfindRequest(w http.ResponseWriter, r *http.Request, t *torrent.To
|
||||
case len(filteredSegments) == 2:
|
||||
output, err = handleSingleTorrent(requestPath, w, r, t)
|
||||
default:
|
||||
log.Errorf("Request %s %s not found", r.Method, requestPath)
|
||||
log.Warnf("Request %s %s not found", r.Method, requestPath)
|
||||
http.Error(w, "Not Found", http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
@@ -54,9 +54,9 @@ func HandlePropfindRequest(w http.ResponseWriter, r *http.Request, t *torrent.To
|
||||
|
||||
func handleRoot(w http.ResponseWriter, r *http.Request, c config.ConfigInterface) ([]byte, error) {
|
||||
var responses []dav.Response
|
||||
responses = append(responses, dav.Directory("/"))
|
||||
responses = append(responses, dav.Directory(""))
|
||||
for _, directory := range c.GetDirectories() {
|
||||
responses = append(responses, dav.Directory("/"+directory))
|
||||
responses = append(responses, dav.Directory(directory))
|
||||
}
|
||||
rootResponse := dav.MultiStatus{
|
||||
XMLNS: "DAV:",
|
||||
@@ -104,7 +104,7 @@ func handleSingleTorrent(requestPath string, w http.ResponseWriter, r *http.Requ
|
||||
accessKey := path.Base(requestPath)
|
||||
torrent, exists := t.TorrentMap.Get(accessKey)
|
||||
if !exists {
|
||||
return nil, fmt.Errorf("cannot find torrent %s", requestPath)
|
||||
return nil, fmt.Errorf("cannot find torrent %s", accessKey)
|
||||
}
|
||||
|
||||
var responses []dav.Response
|
||||
|
||||
Reference in New Issue
Block a user