MCPcopy
hub / github.com/fabiolb/fabio / TestProxyNoRouteStatus

Function TestProxyNoRouteStatus

proxy/http_integration_test.go:211–224  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

209}
210
211func TestProxyNoRouteStatus(t *testing.T) {
212 proxy := httptest.NewServer(&HTTPProxy{
213 ProtectHeaders: testProtectHeaders,
214 Config: config.Proxy{NoRouteStatus: 999},
215 Transport: http.DefaultTransport,
216 Lookup: func(*http.Request) *route.Target { return nil },
217 })
218 defer proxy.Close()
219
220 resp, _ := mustGet(proxy.URL)
221 if got, want := resp.StatusCode, 999; got != want {
222 t.Fatalf("got %d want %d", got, want)
223 }
224}
225
226func TestProxyStripsPath(t *testing.T) {
227 server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

Callers

nothing calls this directly

Calls 2

CloseMethod · 0.95
mustGetFunction · 0.85

Tested by

no test coverage detected