File tree Expand file tree Collapse file tree 3 files changed +19
-4
lines changed
Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 11package xmlrpc
22
3- import "encoding/xml"
3+ import (
4+ "bytes"
5+ "encoding/xml"
6+
7+ "golang.org/x/net/html/charset"
8+ )
49
510// Response is the basic parsed object of the XML-RPC response body.
611// While it's not convenient to use this object directly - it contains all the information needed to unmarshal into other data-types.
@@ -13,7 +18,9 @@ type Response struct {
1318// It relies on XML Unmarshaler and if it fails - error is returned.
1419func NewResponse (body []byte ) (* Response , error ) {
1520 response := & Response {}
16- if err := xml .Unmarshal (body , response ); err != nil {
21+ dec := xml .NewDecoder (bytes .NewReader (body ))
22+ dec .CharsetReader = charset .NewReaderLabel
23+ if err := dec .Decode (response ); err != nil {
1724 return nil , err
1825 }
1926
Original file line number Diff line number Diff line change 11module alexejk.io/go-xmlrpc
22
3- go 1.21
3+ go 1.25.4
44
5- require github.com/stretchr/testify v1.10.0
5+ require (
6+ github.com/stretchr/testify v1.10.0
7+ golang.org/x/net v0.46.0
8+ )
69
710require (
811 github.com/davecgh/go-spew v1.1.1 // indirect
912 github.com/pmezard/go-difflib v1.0.0 // indirect
13+ golang.org/x/text v0.30.0 // indirect
1014 gopkg.in/yaml.v3 v3.0.1 // indirect
1115)
Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
44github.com/pmezard/go-difflib v1.0.0 /go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4 =
55github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA =
66github.com/stretchr/testify v1.10.0 /go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY =
7+ golang.org/x/net v0.46.0 h1:giFlY12I07fugqwPuWJi68oOnpfqFnJIJzaIIm2JVV4 =
8+ golang.org/x/net v0.46.0 /go.mod h1:Q9BGdFy1y4nkUwiLvT5qtyhAnEHgnQ/zd8PfU6nc210 =
9+ golang.org/x/text v0.30.0 h1:yznKA/E9zq54KzlzBEAWn1NXSQ8DIp/NYMy88xJjl4k =
10+ golang.org/x/text v0.30.0 /go.mod h1:yDdHFIX9t+tORqspjENWgzaCVXgk0yYnYuSZ8UzzBVM =
711gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM =
812gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 /go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0 =
913gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA =
You can’t perform that action at this time.
0 commit comments