(proxy connection.OriginProxy)
| 175 | } |
| 176 | |
| 177 | func testProxyHTTP(proxy connection.OriginProxy) func(t *testing.T) { |
| 178 | return func(t *testing.T) { |
| 179 | responseWriter := newMockHTTPRespWriter() |
| 180 | req, err := http.NewRequest(http.MethodGet, "http://localhost:8080", nil) |
| 181 | require.NoError(t, err) |
| 182 | |
| 183 | log := zerolog.Nop() |
| 184 | err = proxy.ProxyHTTP(responseWriter, tracing.NewTracedHTTPRequest(req, 0, &log), false) |
| 185 | require.NoError(t, err) |
| 186 | for _, tag := range testTags { |
| 187 | assert.Equal(t, tag.Value, req.Header.Get(TagHeaderNamePrefix+tag.Name)) |
| 188 | } |
| 189 | |
| 190 | assert.Equal(t, http.StatusOK, responseWriter.Code) |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | func testProxyWebsocket(proxy connection.OriginProxy) func(t *testing.T) { |
| 195 | return func(t *testing.T) { |
no test coverage detected