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

Function TestProxyNoRouteHTML

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

Source from the content-addressed store, hash-verified

193}
194
195func TestProxyNoRouteHTML(t *testing.T) {
196 want := "<html>503</html>"
197 noroute.SetHTML(want)
198 proxy := httptest.NewServer(&HTTPProxy{
199 ProtectHeaders: testProtectHeaders,
200 Transport: http.DefaultTransport,
201 Lookup: func(*http.Request) *route.Target { return nil },
202 })
203 defer proxy.Close()
204
205 _, got := mustGet(proxy.URL)
206 if !bytes.Equal(got, []byte(want)) {
207 t.Fatalf("got %s want %s", got, want)
208 }
209}
210
211func TestProxyNoRouteStatus(t *testing.T) {
212 proxy := httptest.NewServer(&HTTPProxy{

Callers

nothing calls this directly

Calls 3

CloseMethod · 0.95
SetHTMLFunction · 0.92
mustGetFunction · 0.85

Tested by

no test coverage detected