Fix webtorrent not found share

This commit is contained in:
Alexey Khit
2023-03-20 06:15:55 +03:00
parent e1e8abc334
commit acf5ec5256
+5 -1
View File
@@ -99,11 +99,15 @@ func apiHandle(w http.ResponseWriter, r *http.Request) {
return return
} }
if ok { if src != "" {
// response one share // response one share
if ok {
pwd := srv.GetSharePwd(share) pwd := srv.GetSharePwd(share)
data := fmt.Sprintf(`{"share":%q,"pwd":%q}`, share, pwd) data := fmt.Sprintf(`{"share":%q,"pwd":%q}`, share, pwd)
_, _ = w.Write([]byte(data)) _, _ = w.Write([]byte(data))
} else {
http.Error(w, "", http.StatusNotFound)
}
} else { } else {
// response all shares // response all shares
var items []api.Stream var items []api.Stream