Skip to content

decodeJSON will hang #1001

@Khachi-at

Description

@Khachi-at
  • Test codes as follow:
func TestXxx(t *testing.T) {
	server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		w.Write([]byte("null"))
	}))

	client := resty.New().SetRetryCount(DefaultRetryTimes).EnableGenerateCurlCmd()

	x := map[string]string{}

	resp, err := client.R().SetBody("{}").
		SetHeader("Content-Type", "application/json; charset=utf-8").
		SetForceResponseContentType("application/json").
		SetAllowMethodGetPayload(true).
		SetResponseBodyUnlimitedReads(true).
		SetResult(x).
		Get(server.URL + "/test")

	fmt.Println(err)
	fmt.Println(resp.String())
}
  • The decodeJson function will loop infinitely
Image

Metadata

Metadata

Assignees

Labels

bugv3For resty v3

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions