TestHandlerBasicRequest checks basic streaming request
()
| 165 | |
| 166 | // TestHandlerBasicRequest checks basic streaming request |
| 167 | func (s *HandlerTestSuite) TestHandlerBasicRequest() { |
| 168 | data := s.testData.Read("test1.png") |
| 169 | |
| 170 | s.testServer().SetHeaders(httpheaders.ContentType, "image/png").SetBody(data) |
| 171 | |
| 172 | res := s.execute("", nil, options.New()) |
| 173 | defer res.Body.Close() |
| 174 | |
| 175 | s.Require().Equal(200, res.StatusCode) |
| 176 | s.Require().Equal("image/png", res.Header.Get(httpheaders.ContentType)) |
| 177 | |
| 178 | // Verify we get the original image data |
| 179 | actual, err := io.ReadAll(res.Body) |
| 180 | s.Require().NoError(err) |
| 181 | s.Require().Equal(data, actual) |
| 182 | } |
| 183 | |
| 184 | // TestHandlerResponseHeadersPassthrough checks that original response headers are |
| 185 | // passed through to the client |