MCPcopy Create free account
hub / github.com/zalando/skipper / TestLoopbackPreserveHost

Function TestLoopbackPreserveHost

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

Source from the content-addressed store, hash-verified

275}
276
277func TestLoopbackPreserveHost(t *testing.T) {
278 routes := `
279 entry: *
280 -> appendResponseHeader("X-Entry-Route-Done", "true")
281 -> setRequestHeader("X-Loop-Route", "1")
282 -> <loopback>;
283
284 loopRoute1: Header("X-Loop-Route", "1")
285 -> appendResponseHeader("X-Loop-Route-Done", "1")
286 -> setRequestHeader("X-Loop-Route", "2")
287 -> <loopback>;
288
289 loopRoute2: Header("X-Loop-Route", "2")
290 -> appendResponseHeader("X-Loop-Route-Done", "2")
291 -> "$backend";
292 `
293
294 testLoopback(t, routes, Params{Flags: PreserveHost}, nil, http.StatusOK, http.Header{
295 "X-Entry-Route-Done": []string{"true"},
296 "X-Loop-Route-Done": []string{"1", "2"},
297 })
298}
299
300func TestLoopbackDeprecatedFilterShunt(t *testing.T) {
301 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…