perf(webdav): support request with cookies (#5391)

This commit is contained in:
gmugu
2023-10-19 19:17:53 +08:00
committed by GitHub
parent 8ef8023c20
commit aaffaee2b5
2 changed files with 18 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package webdav
import (
"net/http"
"net/http/cookiejar"
"github.com/alist-org/alist/v3/drivers/webdav/odrvcookie"
"github.com/alist-org/alist/v3/internal/model"
@ -26,6 +27,13 @@ func (d *WebDav) setClient() error {
} else {
return err
}
} else {
cookieJar, err := cookiejar.New(nil)
if err == nil {
c.SetJar(cookieJar)
} else {
return err
}
}
d.client = c
return nil