@@ -29,6 +29,7 @@ var _ = Describe("Proxy Suite", func() {
2929 }
3030
3131 ok := http.StatusOK
32+ accepted := http.StatusAccepted
3233
3334 upstreams := options.Upstreams{
3435 {
@@ -47,6 +48,12 @@ var _ = Describe("Proxy Suite", func() {
4748 Static: true,
4849 StaticCode: &ok,
4950 },
51+ {
52+ ID: "static-backend-no-trailing-slash",
53+ Path: "/static",
54+ Static: true,
55+ StaticCode: &accepted,
56+ },
5057 {
5158 ID: "bad-http-backend",
5259 Path: "/bad-http/",
@@ -235,5 +242,25 @@ var _ = Describe("Proxy Suite", func() {
235242 },
236243 upstream: "backend-with-rewrite-prefix",
237244 }),
245+ Entry("with a request to a path, missing the trailing slash", &proxyTableInput{
246+ target: "http://example.localhost/http",
247+ response: testHTTPResponse{
248+ code: 301,
249+ header: map[string][]string{
250+ contentType: {textHTMLUTF8},
251+ "Location": {"http://example.localhost/http/"},
252+ },
253+ raw: "<a href=\"http://example.localhost/http/\">Moved Permanently</a>.\n\n",
254+ },
255+ }),
256+ Entry("with a request to a path, missing the trailing slash, but registered separately", &proxyTableInput{
257+ target: "http://example.localhost/static",
258+ response: testHTTPResponse{
259+ code: 202,
260+ header: map[string][]string{},
261+ raw: "Authenticated",
262+ },
263+ upstream: "static-backend-no-trailing-slash",
264+ }),
238265 )
239266})