👷 Should not force Agent.dest to Agent.dest[:0]

This commit is contained in:
Kiyon 2021-02-22 14:37:31 +08:00
parent 2772af030e
commit f9d1074635
2 changed files with 3 additions and 3 deletions

View File

@ -750,7 +750,7 @@ func (a *Agent) Bytes() (code int, body []byte, errs []error) {
code = resp.StatusCode()
}
body = append(a.dest[:0], resp.Body()...)
body = append(a.dest, resp.Body()...)
if nilResp {
ReleaseResponse(resp)

View File

@ -537,7 +537,7 @@ func Test_Client_Agent_Dest(t *testing.T) {
a.HostClient.Dial = func(addr string) (net.Conn, error) { return ln.Dial() }
code, body, errs := a.Dest(dest).String()
code, body, errs := a.Dest(dest[:0]).String()
utils.AssertEqual(t, StatusOK, code)
utils.AssertEqual(t, "dest", body)
@ -552,7 +552,7 @@ func Test_Client_Agent_Dest(t *testing.T) {
a.HostClient.Dial = func(addr string) (net.Conn, error) { return ln.Dial() }
code, body, errs := a.Dest(dest).String()
code, body, errs := a.Dest(dest[:0]).String()
utils.AssertEqual(t, StatusOK, code)
utils.AssertEqual(t, "dest", body)