@@ -51,6 +51,12 @@ var _ = Describe("Proxy Suite", func() {
5151 Path: "/files/",
5252 URI: fmt.Sprintf("file:///%s", filesDir),
5353 },
54+ {
55+ ID: "rewrite-file-backend",
56+ Path: "^/rewrite-files/.*/(.*)$",
57+ RewriteTarget: "/$1",
58+ URI: fmt.Sprintf("file:///%s", filesDir),
59+ },
5460 {
5561 ID: "static-backend",
5662 Path: "/static/",
@@ -174,6 +180,17 @@ var _ = Describe("Proxy Suite", func() {
174180 },
175181 upstream: "file-backend",
176182 }),
183+ Entry("with a request to the File backend with rewrite", &proxyTableInput{
184+ target: "http://example.localhost/rewrite-files/anything-at-all/foo",
185+ response: testHTTPResponse{
186+ code: 200,
187+ header: map[string][]string{
188+ contentType: {textPlainUTF8},
189+ },
190+ raw: "foo",
191+ },
192+ upstream: "rewrite-file-backend",
193+ }),
177194 Entry("with a request to the Static backend", &proxyTableInput{
178195 target: "http://example.localhost/static/bar",
179196 response: testHTTPResponse{