1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-05-21 22:33:38 +02:00

Test for a file:/// upstream combined with regex path rewrite

This commit is contained in:
Ian Roberts 2023-09-21 14:55:05 +01:00
parent 076d2df246
commit b618ed7150

View File

@ -51,6 +51,12 @@ var _ = Describe("Proxy Suite", func() {
Path: "/files/",
URI: fmt.Sprintf("file:///%s", filesDir),
},
{
ID: "rewrite-file-backend",
Path: "^/rewrite-files/.*/(.*)$",
RewriteTarget: "/$1",
URI: fmt.Sprintf("file:///%s", filesDir),
},
{
ID: "static-backend",
Path: "/static/",
@ -174,6 +180,17 @@ var _ = Describe("Proxy Suite", func() {
},
upstream: "file-backend",
}),
Entry("with a request to the File backend with rewrite", &proxyTableInput{
target: "http://example.localhost/rewrite-files/anything-at-all/foo",
response: testHTTPResponse{
code: 200,
header: map[string][]string{
contentType: {textPlainUTF8},
},
raw: "foo",
},
upstream: "rewrite-file-backend",
}),
Entry("with a request to the Static backend", &proxyTableInput{
target: "http://example.localhost/static/bar",
response: testHTTPResponse{