(t *testing.T)
| 298 | } |
| 299 | |
| 300 | func TestLoopbackDeprecatedFilterShunt(t *testing.T) { |
| 301 | routes := ` |
| 302 | entry: * |
| 303 | -> appendResponseHeader("X-Entry-Route-Done", "true") |
| 304 | -> setRequestHeader("X-Loop-Route", "1") |
| 305 | -> <loopback>; |
| 306 | |
| 307 | loopRoute1: Header("X-Loop-Route", "1") |
| 308 | -> appendResponseHeader("X-Loop-Route-Done", "1") |
| 309 | -> redirect(302, "/test/path") |
| 310 | -> setRequestHeader("X-Loop-Route", "2") |
| 311 | -> <loopback>; |
| 312 | |
| 313 | loopRoute2: Header("X-Loop-Route", "2") |
| 314 | -> appendResponseHeader("X-Loop-Route-Done", "2") |
| 315 | -> "$backend"; |
| 316 | ` |
| 317 | |
| 318 | // NOTE: the deprecated filter shunting executed the remaining filters, preserving here this wrong |
| 319 | // behavior to avoid making unrelated changes |
| 320 | testLoopback(t, routes, Params{}, nil, http.StatusFound, http.Header{ |
| 321 | "X-Entry-Route-Done": []string{"true"}, |
| 322 | "X-Loop-Route-Done": []string{"1", "2"}, |
| 323 | "X-Loop-Backend-Done": nil, |
| 324 | }) |
| 325 | } |
| 326 | |
| 327 | func TestLoopbackFilterShunt(t *testing.T) { |
| 328 | routes := ` |
nothing calls this directly
no test coverage detected
searching dependent graphs…