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

Function TestLoopbackPreserveOriginalRequest

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

Source from the content-addressed store, hash-verified

251}
252
253func TestLoopbackPreserveOriginalRequest(t *testing.T) {
254 routes := `
255 entry: *
256 -> appendResponseHeader("X-Entry-Route-Done", "true")
257 -> setRequestHeader("X-Loop-Route", "1")
258 -> preserveOriginal()
259 -> <loopback>;
260
261 loopRoute1: Header("X-Loop-Route", "1")
262 -> appendResponseHeader("X-Loop-Route-Done", "1")
263 -> setRequestHeader("X-Loop-Route", "2")
264 -> <loopback>;
265
266 loopRoute2: Header("X-Loop-Route", "2")
267 -> appendResponseHeader("X-Loop-Route-Done", "2")
268 -> "$backend";
269 `
270
271 testLoopback(t, routes, Params{Flags: PreserveOriginal}, nil, http.StatusOK, http.Header{
272 "X-Entry-Route-Done": []string{"true"},
273 "X-Loop-Route-Done": []string{"1", "2"},
274 })
275}
276
277func TestLoopbackPreserveHost(t *testing.T) {
278 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…