Fix ipv6 replacement
This commit is contained in:
@@ -96,7 +96,7 @@ func ServeFilesListForInfuse(directory, torrentName string, torMgr *torrent.Torr
|
|||||||
func ServeDownloadsListForInfuse(torMgr *torrent.TorrentManager) ([]byte, error) {
|
func ServeDownloadsListForInfuse(torMgr *torrent.TorrentManager) ([]byte, error) {
|
||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
if !torMgr.Config.EnableDownloadMount() {
|
if !torMgr.Config.EnableDownloadMount() {
|
||||||
buf.WriteString("Enable download cache in config to use this feature")
|
buf.WriteString("Enable download mount in config to use this feature")
|
||||||
return buf.Bytes(), nil
|
return buf.Bytes(), nil
|
||||||
}
|
}
|
||||||
buf.WriteString("<?xml version=\"1.0\" encoding=\"utf-8\"?><d:multistatus xmlns:d=\"DAV:\">")
|
buf.WriteString("<?xml version=\"1.0\" encoding=\"utf-8\"?><d:multistatus xmlns:d=\"DAV:\">")
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ func HandleSingleFile(directory, torrentName, fileName string, torMgr *torrent.T
|
|||||||
func ServeDownloadsList(torMgr *torrent.TorrentManager) ([]byte, error) {
|
func ServeDownloadsList(torMgr *torrent.TorrentManager) ([]byte, error) {
|
||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
if !torMgr.Config.EnableDownloadMount() {
|
if !torMgr.Config.EnableDownloadMount() {
|
||||||
buf.WriteString("Enable download cache in config to use this feature")
|
buf.WriteString("Enable download mount in config to use this feature")
|
||||||
return buf.Bytes(), nil
|
return buf.Bytes(), nil
|
||||||
}
|
}
|
||||||
buf.WriteString("<?xml version=\"1.0\" encoding=\"utf-8\"?><d:multistatus xmlns:d=\"DAV:\">")
|
buf.WriteString("<?xml version=\"1.0\" encoding=\"utf-8\"?><d:multistatus xmlns:d=\"DAV:\">")
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ func (zr *Handlers) handleHome(resp http.ResponseWriter, req *http.Request) {
|
|||||||
<td>%d</td>
|
<td>%d</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Use Download Cache</td>
|
<td>Use Download Mount</td>
|
||||||
<td>%t</td>
|
<td>%t</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ func ServeFilesList(directory, torrentName string, torMgr *torrent.TorrentManage
|
|||||||
func ServeDownloadsList(torMgr *torrent.TorrentManager) ([]byte, error) {
|
func ServeDownloadsList(torMgr *torrent.TorrentManager) ([]byte, error) {
|
||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
if !torMgr.Config.EnableDownloadMount() {
|
if !torMgr.Config.EnableDownloadMount() {
|
||||||
buf.WriteString("Enable download cache in config to use this feature")
|
buf.WriteString("Enable download mount in config to use this feature")
|
||||||
return buf.Bytes(), nil
|
return buf.Bytes(), nil
|
||||||
}
|
}
|
||||||
buf.WriteString("<ol>")
|
buf.WriteString("<ol>")
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ func (r *HTTPClient) Do(req *http.Request) (*http.Response, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (r *HTTPClient) replaceHostIfNeeded(req *http.Request) {
|
func (r *HTTPClient) replaceHostIfNeeded(req *http.Request) {
|
||||||
if !r.ensureIPv6Host && !r.cfg.ShouldForceIPv6() || !strings.HasSuffix(req.Host, "download.real-debrid.com") {
|
if strings.HasSuffix(req.Host, "download.real-debrid.cloud") || !r.ensureIPv6Host || !r.cfg.ShouldForceIPv6() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// get subdomain of req.Host
|
// get subdomain of req.Host
|
||||||
|
|||||||
Reference in New Issue
Block a user