readMultiPartBody reads a multipart response body and returns the parts as strings
(t *testing.T, response *TestResponse)
| 319 | |
| 320 | // readMultiPartBody reads a multipart response body and returns the parts as strings |
| 321 | func readMultiPartBody(t *testing.T, response *TestResponse) []string { |
| 322 | _, params, err := mime.ParseMediaType(response.Header().Get("Content-Type")) |
| 323 | require.NoError(t, err) |
| 324 | mr := multipart.NewReader(response.Body, params["boundary"]) |
| 325 | var output []string |
| 326 | for { |
| 327 | p, err := mr.NextPart() |
| 328 | if err == io.EOF { |
| 329 | break |
| 330 | } |
| 331 | require.NoError(t, err) |
| 332 | bodyBytes, err := io.ReadAll(p) |
| 333 | require.NoError(t, err) |
| 334 | output = append(output, string(bodyBytes)) |
| 335 | } |
| 336 | return output |
| 337 | } |
| 338 | |
| 339 | func TestCVUnescapedRevQueryParam(t *testing.T) { |
| 340 | tests := []struct { |
no test coverage detected