Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: revert go-resty fork #167

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,19 @@ func (c *Client) UploadAttachment(ctx context.Context, addrKR *crypto.KeyRing, r
Param: "KeyPackets",
FileName: "blob",
ContentType: "application/octet-stream",
Stream: resty.NewByteMultipartStream(enc.KeyPacket),
Reader: bytes.NewReader(enc.KeyPacket),
},
&resty.MultipartField{
Param: "DataPacket",
FileName: "blob",
ContentType: "application/octet-stream",
Stream: resty.NewByteMultipartStream(enc.DataPacket),
Reader: bytes.NewReader(enc.DataPacket),
},
&resty.MultipartField{
Param: "Signature",
FileName: "blob",
ContentType: "application/octet-stream",
Stream: resty.NewByteMultipartStream(sig.GetBinary()),
Reader: bytes.NewReader(sig.GetBinary()),
},
).
Post("/mail/v4/attachments")
Expand Down
2 changes: 1 addition & 1 deletion block.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (c *Client) RequestBlockUpload(ctx context.Context, req BlockUploadReq) ([]
return res.UploadLinks, nil
}

func (c *Client) UploadBlock(ctx context.Context, bareURL, token string, block resty.MultiPartStream) error {
func (c *Client) UploadBlock(ctx context.Context, bareURL, token string, block io.Reader) error {
return c.do(ctx, func(r *resty.Request) (*resty.Response, error) {
return r.
SetHeader("pm-storage-token", token).
Expand Down
10 changes: 4 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ require (
github.com/emersion/go-message v0.16.0
github.com/emersion/go-vcard v0.0.0-20230331202150-f3d26859ccd3
github.com/gin-gonic/gin v1.9.1
github.com/go-resty/resty/v2 v2.7.0
github.com/google/uuid v1.3.0
github.com/sirupsen/logrus v1.9.2
github.com/go-resty/resty/v2 v2.16.3
github.com/google/uuid v1.6.0
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.8.3
github.com/urfave/cli/v2 v2.24.4
gitlab.com/c0b/go-ordered-json v0.0.0-20201030195603-febf46534d5a
Expand All @@ -30,7 +30,7 @@ require (
require (
github.com/ProtonMail/bcrypt v0.0.0-20211005172633-e235017c1baf // indirect
github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f // indirect
github.com/andybalholm/cascadia v1.3.2 // indirect
github.com/andybalholm/cascadia v1.3.3 // indirect
github.com/bytedance/sonic v1.9.1 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/cloudflare/circl v1.5.0 // indirect
Expand Down Expand Up @@ -67,5 +67,3 @@ require (
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/go-resty/resty/v2 => github.com/LBeernaertProton/resty/v2 v2.0.0-20231129100320-dddf8030d93a
Loading