Add mail attachment download support for 2dph integration.
Release Please / Release Please (push) Skipped
Release / GoReleaser (push) Skipped
Tests / Test (Go 1.25) (push) Skipped
Tests / Test (Go stable) (push) Skipped
Tests / Test (Go 1.25) (pull_request) Successful in 50s
Tests / Test (Go stable) (pull_request) Successful in 51s

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:
2026-08-19 12:05:25 +01:00
parent a3a6ad3543
commit 1ef0670624
3 changed files with 99 additions and 1 deletions
+3 -1
View File
@@ -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,
}
}