Fix webtorrent not found share
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user