@@ -24,6 +24,7 @@ var _ = Describe("Legacy Options", func() {
2424 legacyOpts.LegacyUpstreams.SSLUpstreamInsecureSkipVerify = true
2525 legacyOpts.LegacyUpstreams.Upstreams = []string{"http://foo.bar/baz", "file:///var/lib/website#/bar", "static://204"}
2626 legacyOpts.LegacyProvider.ClientID = "oauth-proxy"
27+ legacyOpts.LegacyUpstreams.DisableKeepAlives = false
2728
2829 truth := true
2930 staticCode := 204
@@ -38,6 +39,7 @@ var _ = Describe("Legacy Options", func() {
3839 PassHostHeader: &truth,
3940 ProxyWebSockets: &truth,
4041 Timeout: &timeout,
42+ DisableKeepAlives: legacyOpts.LegacyUpstreams.DisableKeepAlives,
4143 },
4244 {
4345 ID: "/bar",
@@ -48,6 +50,7 @@ var _ = Describe("Legacy Options", func() {
4850 PassHostHeader: &truth,
4951 ProxyWebSockets: &truth,
5052 Timeout: &timeout,
53+ DisableKeepAlives: legacyOpts.LegacyUpstreams.DisableKeepAlives,
5154 },
5255 {
5356 ID: "static://204",
@@ -60,6 +63,7 @@ var _ = Describe("Legacy Options", func() {
6063 PassHostHeader: nil,
6164 ProxyWebSockets: nil,
6265 Timeout: nil,
66+ DisableKeepAlives: legacyOpts.LegacyUpstreams.DisableKeepAlives,
6367 },
6468 },
6569 }
@@ -145,6 +149,7 @@ var _ = Describe("Legacy Options", func() {
145149 proxyWebSockets := true
146150 flushInterval := Duration(5 * time.Second)
147151 timeout := Duration(5 * time.Second)
152+ disableKeepAlives := true
148153
149154 // Test cases and expected outcomes
150155 validHTTP := "http://foo.bar/baz"
@@ -157,6 +162,7 @@ var _ = Describe("Legacy Options", func() {
157162 ProxyWebSockets: &proxyWebSockets,
158163 FlushInterval: &flushInterval,
159164 Timeout: &timeout,
165+ DisableKeepAlives: disableKeepAlives,
160166 }
161167
162168 // Test cases and expected outcomes
@@ -170,6 +176,7 @@ var _ = Describe("Legacy Options", func() {
170176 ProxyWebSockets: &proxyWebSockets,
171177 FlushInterval: &flushInterval,
172178 Timeout: &timeout,
179+ DisableKeepAlives: disableKeepAlives,
173180 }
174181
175182 validFileWithFragment := "file:///var/lib/website#/bar"
@@ -182,6 +189,7 @@ var _ = Describe("Legacy Options", func() {
182189 ProxyWebSockets: &proxyWebSockets,
183190 FlushInterval: &flushInterval,
184191 Timeout: &timeout,
192+ DisableKeepAlives: disableKeepAlives,
185193 }
186194
187195 validStatic := "static://204"
@@ -197,6 +205,7 @@ var _ = Describe("Legacy Options", func() {
197205 ProxyWebSockets: nil,
198206 FlushInterval: nil,
199207 Timeout: nil,
208+ DisableKeepAlives: false,
200209 }
201210
202211 invalidStatic := "static://abc"
@@ -212,6 +221,7 @@ var _ = Describe("Legacy Options", func() {
212221 ProxyWebSockets: nil,
213222 FlushInterval: nil,
214223 Timeout: nil,
224+ DisableKeepAlives: false,
215225 }
216226
217227 invalidHTTP := ":foo"
@@ -226,6 +236,7 @@ var _ = Describe("Legacy Options", func() {
226236 ProxyWebSockets: proxyWebSockets,
227237 FlushInterval: time.Duration(flushInterval),
228238 Timeout: time.Duration(timeout),
239+ DisableKeepAlives: disableKeepAlives,
229240 }
230241
231242 upstreams, err := legacyUpstreams.convert()