Add mail attachment download support for 2dph integration.
This gives go-onlyoffice a cookie-backed attachment download path so 2dph can reuse the canonical OnlyOffice client instead of keeping a local mail adapter.
This commit is contained in:
@@ -11,6 +11,7 @@ package onlyoffice
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/http/cookiejar"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
@@ -35,8 +36,9 @@ type Client struct {
|
||||
|
||||
// NewClient returns a new Client backed by http.DefaultClient.
|
||||
func NewClient(c Credentials) *Client {
|
||||
jar, _ := cookiejar.New(nil)
|
||||
return &Client{
|
||||
client: http.DefaultClient,
|
||||
client: &http.Client{Jar: jar},
|
||||
credentials: &c,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user