| 193 | } |
| 194 | |
| 195 | func 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 | |
| 211 | func TestProxyNoRouteStatus(t *testing.T) { |
| 212 | proxy := httptest.NewServer(&HTTPProxy{ |