| 209 | } |
| 210 | |
| 211 | func 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 | |
| 226 | func TestProxyStripsPath(t *testing.T) { |
| 227 | server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |