MCPcopy Index your code
hub / github.com/zalando/skipper / TestLoopbackDeprecatedFilterShunt

Function TestLoopbackDeprecatedFilterShunt

proxy/loopback_test.go:300–325  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

298}
299
300func 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
327func TestLoopbackFilterShunt(t *testing.T) {
328 routes := `

Callers

nothing calls this directly

Calls 1

testLoopbackFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…