Regression test to guarantee that we always write the contents downstream even if EOF is reached without hitting the delimiter
(t *testing.T)
| 291 | // Regression test to guarantee that we always write the contents downstream even if EOF is reached without |
| 292 | // hitting the delimiter |
| 293 | func TestProxySSEAllData(t *testing.T) { |
| 294 | eyeballReader := io.NopCloser(strings.NewReader("data\r\r")) |
| 295 | responseWriter := newMockSSERespWriter() |
| 296 | |
| 297 | // responseWriter uses an unbuffered channel, so we call in a different go-routine |
| 298 | go func() { |
| 299 | _, _ = cfio.Copy(responseWriter, eyeballReader) |
| 300 | }() |
| 301 | |
| 302 | result := string(<-responseWriter.writeNotification) |
| 303 | require.Equal(t, "data\r\r", result) |
| 304 | } |
| 305 | |
| 306 | func TestProxyMultipleOrigins(t *testing.T) { |
| 307 | api := httptest.NewServer(mockAPI{}) |
nothing calls this directly
no test coverage detected