Skip to content

Commit b06fd38

Browse files
committed
fix: revert go-resty fork
reverts 17c9b5b Stop using a custom version of go-resty. The original reason for forking resty has since been fixed. See: - go-resty/resty#334 - go-resty/resty#879
1 parent 98a73ff commit b06fd38

File tree

6 files changed

+91
-127
lines changed

6 files changed

+91
-127
lines changed

attachment.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,19 @@ func (c *Client) UploadAttachment(ctx context.Context, addrKR *crypto.KeyRing, r
5656
Param: "KeyPackets",
5757
FileName: "blob",
5858
ContentType: "application/octet-stream",
59-
Stream: resty.NewByteMultipartStream(enc.KeyPacket),
59+
Reader: bytes.NewReader(enc.KeyPacket),
6060
},
6161
&resty.MultipartField{
6262
Param: "DataPacket",
6363
FileName: "blob",
6464
ContentType: "application/octet-stream",
65-
Stream: resty.NewByteMultipartStream(enc.DataPacket),
65+
Reader: bytes.NewReader(enc.DataPacket),
6666
},
6767
&resty.MultipartField{
6868
Param: "Signature",
6969
FileName: "blob",
7070
ContentType: "application/octet-stream",
71-
Stream: resty.NewByteMultipartStream(sig.GetBinary()),
71+
Reader: bytes.NewReader(sig.GetBinary()),
7272
},
7373
).
7474
Post("/mail/v4/attachments")

block.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func (c *Client) RequestBlockUpload(ctx context.Context, req BlockUploadReq) ([]
3232
return res.UploadLinks, nil
3333
}
3434

35-
func (c *Client) UploadBlock(ctx context.Context, bareURL, token string, block resty.MultiPartStream) error {
35+
func (c *Client) UploadBlock(ctx context.Context, bareURL, token string, block io.Reader) error {
3636
return c.do(ctx, func(r *resty.Request) (*resty.Response, error) {
3737
return r.
3838
SetHeader("pm-storage-token", token).

go.mod

+20-20
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,41 @@
11
module github.com/ProtonMail/go-proton-api
22

3-
go 1.21
3+
go 1.23
4+
5+
toolchain go1.23.4
46

57
require (
68
github.com/Masterminds/semver/v3 v3.2.0
79
github.com/ProtonMail/gluon v0.17.1-0.20230724134000-308be39be96e
8-
github.com/ProtonMail/go-crypto v0.0.0-20230717121622-edf196117233
10+
github.com/ProtonMail/go-crypto v1.1.5
911
github.com/ProtonMail/go-srp v0.0.7
10-
github.com/ProtonMail/gopenpgp/v2 v2.7.4-proton
11-
github.com/PuerkitoBio/goquery v1.8.1
12-
github.com/bradenaw/juniper v0.12.0
13-
github.com/emersion/go-message v0.16.0
14-
github.com/emersion/go-vcard v0.0.0-20230331202150-f3d26859ccd3
12+
github.com/ProtonMail/gopenpgp/v2 v2.8.2
13+
github.com/PuerkitoBio/goquery v1.10.1
14+
github.com/bradenaw/juniper v0.15.3
15+
github.com/emersion/go-message v0.18.2
16+
github.com/emersion/go-vcard v0.0.0-20241024213814-c9703dde27ff
1517
github.com/gin-gonic/gin v1.9.1
16-
github.com/go-resty/resty/v2 v2.7.0
17-
github.com/google/uuid v1.3.0
18-
github.com/sirupsen/logrus v1.9.2
18+
github.com/go-resty/resty/v2 v2.16.3
19+
github.com/google/uuid v1.6.0
20+
github.com/sirupsen/logrus v1.9.3
1921
github.com/stretchr/testify v1.8.3
2022
github.com/urfave/cli/v2 v2.24.4
2123
gitlab.com/c0b/go-ordered-json v0.0.0-20201030195603-febf46534d5a
2224
go.uber.org/goleak v1.2.1
23-
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1
24-
golang.org/x/net v0.24.0
25-
golang.org/x/text v0.14.0
25+
golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8
26+
golang.org/x/net v0.34.0
27+
golang.org/x/text v0.21.0
2628
google.golang.org/grpc v1.56.3
2729
google.golang.org/protobuf v1.33.0
2830
)
2931

3032
require (
3133
github.com/ProtonMail/bcrypt v0.0.0-20211005172633-e235017c1baf // indirect
3234
github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f // indirect
33-
github.com/andybalholm/cascadia v1.3.2 // indirect
35+
github.com/andybalholm/cascadia v1.3.3 // indirect
3436
github.com/bytedance/sonic v1.9.1 // indirect
3537
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
36-
github.com/cloudflare/circl v1.3.7 // indirect
38+
github.com/cloudflare/circl v1.5.0 // indirect
3739
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
3840
github.com/cronokirby/saferith v0.33.0 // indirect
3941
github.com/davecgh/go-spew v1.1.1 // indirect
@@ -61,11 +63,9 @@ require (
6163
github.com/ugorji/go/codec v1.2.11 // indirect
6264
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
6365
golang.org/x/arch v0.3.0 // indirect
64-
golang.org/x/crypto v0.22.0 // indirect
65-
golang.org/x/sync v0.2.0 // indirect
66-
golang.org/x/sys v0.19.0 // indirect
66+
golang.org/x/crypto v0.32.0 // indirect
67+
golang.org/x/sync v0.10.0 // indirect
68+
golang.org/x/sys v0.29.0 // indirect
6769
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
6870
gopkg.in/yaml.v3 v3.0.1 // indirect
6971
)
70-
71-
replace github.com/go-resty/resty/v2 => github.com/LBeernaertProton/resty/v2 v2.0.0-20231129100320-dddf8030d93a

0 commit comments

Comments
 (0)