Skip to content

Commit 5b8ee57

Browse files
committed
ENH: Moves httpsPort to serviceDest
1 parent 280217b commit 5b8ee57

8 files changed

Lines changed: 35 additions & 38 deletions

File tree

actions/reconfigure_test.go

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,9 @@ func (s ReconfigureTestSuite) Test_GetTemplates_AddsHttpAuth_WhenUsersIsPresent(
139139
{Username: "user-1", Password: "pass-1"},
140140
{Username: "user-2", Password: "pass-2"},
141141
}
142-
s.reconfigure.HttpsPort = 3333
143142
sd := []proxy.ServiceDest{
144-
{Port: "1111", Index: 0},
145-
{Port: "2222", IgnoreAuthorization: true, Index: 1},
143+
{Port: "1111", Index: 0, HttpsPort: 3333},
144+
{Port: "2222", IgnoreAuthorization: true, Index: 1, HttpsPort: 3333},
146145
}
147146
s.reconfigure.Service.ServiceDest = sd
148147
expected := `userlist myServiceUsers
@@ -252,7 +251,7 @@ backend myService-be1234_3
252251
}
253252

254253
func (s ReconfigureTestSuite) Test_GetTemplates_AddsRequestDeny_WhenNotOneOfAllowedMethods() {
255-
s.reconfigure.Service.HttpsPort = 4321
254+
s.reconfigure.Service.ServiceDest[0].HttpsPort = 4321
256255
s.reconfigure.Service.ServiceDest[0].Port = "1234"
257256
s.reconfigure.Service.ServiceDest[0].AllowedMethods = []string{"GET", "DELETE"}
258257
s.reconfigure.Service.ServiceDest[0].Index = 2
@@ -276,7 +275,7 @@ backend https-myService-be1234_2
276275
}
277276

278277
func (s ReconfigureTestSuite) Test_GetTemplates_AddsRequestDeny_WhenOneOfDeniedMethods() {
279-
s.reconfigure.Service.HttpsPort = 4321
278+
s.reconfigure.Service.ServiceDest[0].HttpsPort = 4321
280279
s.reconfigure.Service.ServiceDest[0].Port = "1234"
281280
s.reconfigure.Service.ServiceDest[0].Index = 5
282281
s.reconfigure.Service.ServiceDest[0].DeniedMethods = []string{"GET", "DELETE"}
@@ -300,7 +299,7 @@ backend https-myService-be1234_5
300299
}
301300

302301
func (s ReconfigureTestSuite) Test_GetTemplates_AddsHttpDeny() {
303-
s.reconfigure.Service.HttpsPort = 4321
302+
s.reconfigure.Service.ServiceDest[0].HttpsPort = 4321
304303
s.reconfigure.Service.ServiceDest[0].Port = "1234"
305304
s.reconfigure.Service.ServiceDest[0].DenyHttp = true
306305
s.reconfigure.Service.ServiceDest[0].Index = 32
@@ -377,7 +376,7 @@ backend https-myService-be1234_3
377376
server myService myService:4321`
378377
s.reconfigure.ServiceDest[0].Port = "1234"
379378
s.reconfigure.ServiceDest[0].Index = 3
380-
s.reconfigure.HttpsPort = 4321
379+
s.reconfigure.ServiceDest[0].HttpsPort = 4321
381380
actualFront, actualBack, _ := s.reconfigure.GetTemplates()
382381

383382
s.Equal("", actualFront)
@@ -395,7 +394,7 @@ backend https-myService-be1234_0
395394
http-request add-header X-Forwarded-Proto https if { ssl_fc }
396395
server-template myService 7 myService:4321 check`
397396
s.reconfigure.ServiceDest[0].Port = "1234"
398-
s.reconfigure.HttpsPort = 4321
397+
s.reconfigure.ServiceDest[0].HttpsPort = 4321
399398
s.reconfigure.Replicas = 7
400399
s.reconfigure.DiscoveryType = "DNS"
401400
actualFront, actualBack, _ := s.reconfigure.GetTemplates()
@@ -427,7 +426,7 @@ backend https-myService-be1234_0
427426
http-request add-header X-Forwarded-Proto https if { ssl_fc }
428427
server-template myService 3 myService:4321 check`
429428
s.reconfigure.ServiceDest[0].Port = "1234"
430-
s.reconfigure.HttpsPort = 4321
429+
s.reconfigure.ServiceDest[0].HttpsPort = 4321
431430
s.reconfigure.Replicas = 0
432431
s.reconfigure.DiscoveryType = "DNS"
433432
actualFront, actualBack, _ := s.reconfigure.GetTemplates()
@@ -454,7 +453,7 @@ backend myService-be1234_0
454453
}
455454

456455
func (s ReconfigureTestSuite) Test_GetTemplates_UsesOutboundHostname() {
457-
s.reconfigure.Service.HttpsPort = 4321
456+
s.reconfigure.Service.ServiceDest[0].HttpsPort = 4321
458457
s.reconfigure.Service.ServiceDest[0].Port = "1234"
459458
s.reconfigure.Service.ServiceDest[0].Index = 1
460459
s.reconfigure.Service.ServiceDest[0].OutboundHostname = "acme.com"
@@ -531,11 +530,11 @@ backend myService-be5555_2
531530
}
532531

533532
func (s ReconfigureTestSuite) Test_GetTemplates_AddsHttpRequestSetPath_WhenReqPathSearchReplaceFormattedIsPresent() {
534-
s.reconfigure.HttpsPort = 1234
535533
s.reconfigure.ServiceDest = []proxy.ServiceDest{{
536534
Port: "1234",
537535
Index: 0,
538536
ReqPathSearchReplaceFormatted: []string{"this,that", "foo,bar"},
537+
HttpsPort: 1234,
539538
}}
540539
expected := `
541540
backend myService-be1234_0
@@ -737,7 +736,7 @@ func (s ReconfigureTestSuite) Test_Execute_WritesServerSession() {
737736
s.reconfigure.ServiceName = "my-service"
738737
s.reconfigure.AclName = "my-service"
739738
s.reconfigure.ServiceDest[0].Port = "1111"
740-
s.reconfigure.HttpsPort = 2222
739+
s.reconfigure.ServiceDest[0].HttpsPort = 2222
741740
s.reconfigure.Tasks = []string{"1.2.3.4", "4.3.2.1"}
742741
s.reconfigure.SessionType = "sticky-server"
743742
var actualData string

docs/usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The following query parameters can be used to send a *reconfigure* request to *D
4040
|timeoutTunnel |The tunnel timeout in seconds.<br>**Default:** `3600`<br>**Example:** `3600`|
4141
|userDef |User defined value. This value is not used with current template. It is designed as a way to provide additional data that can be used with **custom templates**. The parameter must be prefixed with an index thus allowing definition of multiple destinations for a single service (e.g. `userDef.1`, `userDef.2`, and so on).|
4242

43-
Multiple destinations for a single service can be specified by adding index as a suffix to `servicePath`, `servicePathExclude`, `srcPort`, `port`, `userAgent`, `ignoreAuthorization`, `serviceDomain`, `allowedMethods`, `deniedMethods`, `denyHttp`, `httpsOnly`, `redirectFromDomain`, `reqMode`, `reqPathSearchReplace`, `outboundHostname`, `sslVerifyNone`, `timeoutServer`, `timeoutTunnel`, or `userDef` parameters. In that case, `srcPort` is required.
43+
Multiple destinations for a single service can be specified by adding index as a suffix to `servicePath`, `servicePathExclude`, `srcPort`, `port`, `userAgent`, `ignoreAuthorization`, `serviceDomain`, `allowedMethods`, `deniedMethods`, `denyHttp`, `httpsOnly`, `httpsPort`, `redirectFromDomain`, `reqMode`, `reqPathSearchReplace`, `outboundHostname`, `sslVerifyNone`, `timeoutServer`, `timeoutTunnel`, or `userDef` parameters. In that case, `srcPort` is required.
4444

4545
### HTTP Mode Query Parameters
4646

proxy/ha_proxy_test.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -806,9 +806,8 @@ func (s HaProxyTestSuite) Test_CreateConfigFromTemplates_AddsServicePathExclude(
806806
service := Service{
807807
ServiceName: "my-service-1",
808808
PathType: "path_beg",
809-
HttpsPort: 2222,
810809
ServiceDest: []ServiceDest{
811-
{Port: "1111", ServicePath: []string{"/path-1"}, ServicePathExclude: []string{"/path-2", "/path-3"}},
810+
{Port: "1111", HttpsPort: 2222, ServicePath: []string{"/path-1"}, ServicePathExclude: []string{"/path-2", "/path-3"}},
812811
},
813812
}
814813
p.AddService(service)
@@ -1848,10 +1847,9 @@ func (s HaProxyTestSuite) Test_CreateConfigFromTemplates_AddsContentFrontEndWith
18481847
service1 := Service{
18491848
ServiceName: "my-service",
18501849
PathType: "path_beg",
1851-
HttpsPort: 2222,
18521850
AclName: "my-service",
18531851
ServiceDest: []ServiceDest{
1854-
{Port: "1111", ServicePath: []string{"/path"}},
1852+
{Port: "1111", ServicePath: []string{"/path"}, HttpsPort: 2222},
18551853
},
18561854
}
18571855
p.AddService(service1)
@@ -1883,11 +1881,10 @@ func (s HaProxyTestSuite) Test_CreateConfigFromTemplates_AddsContentFrontEndWith
18831881
service1 := Service{
18841882
ServiceName: "my-service",
18851883
PathType: "path_beg",
1886-
HttpsPort: 2222,
18871884
AclName: "my-service",
18881885
ServiceDest: []ServiceDest{
18891886
{Port: "1111", ServicePath: []string{"/path"},
1890-
SrcPort: 8080},
1887+
SrcPort: 8080, HttpsPort: 2222},
18911888
},
18921889
}
18931890
p.AddService(service1)

proxy/template.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func getFrontTemplate(s Service) string {
3737
acl hdr_{{$.AclName}}{{$sd.Port}}_{{incIndex}} hdr({{$key}}) {{$value}}
3838
{{- end}}
3939
{{- end}}
40-
{{- if gt $.HttpsPort 0 }}
40+
{{- if gt $sd.HttpsPort 0 }}
4141
acl http_{{$.ServiceName}}_{{.Index}} dst_port {{ if gt .SrcPort 0 }}{{.SrcPort}}{{ else }}80{{ end }}
4242
acl https_{{$.ServiceName}}_{{.Index}} dst_port 443
4343
{{- end}}
@@ -58,7 +58,7 @@ func getFrontTemplate(s Service) string {
5858
{{- range $sd := .ServiceDest}}
5959
{{- if eq .ReqMode "http"}}{{- if ne .Port ""}}
6060
use_backend {{$.AclName}}-be{{.Port}}_{{.Index}} if url_{{$.AclName}}{{.Port}}_{{.Index}}{{if .ServicePathExclude}} !url_exclude_{{$.AclName}}{{.Port}}_{{.Index}}{{end}}{{if .ServiceDomain}} domain_{{$.AclName}}{{.Port}}_{{.Index}}{{end}}{{if .ServiceHeader}}{{resetIndex}}{{range $key, $value := .ServiceHeader}} hdr_{{$.AclName}}{{$sd.Port}}_{{incIndex}}{{end}}{{end}}{{.SrcPortAclName}}
61-
{{- if gt $.HttpsPort 0 }} http_{{$.ServiceName}}_{{.Index}}
61+
{{- if gt $sd.HttpsPort 0 }} http_{{$.ServiceName}}_{{.Index}}
6262
use_backend https-{{$.AclName}}-be{{.Port}}_{{.Index}} if url_{{$.AclName}}{{.Port}}_{{.Index}}{{if .ServicePathExclude}} !url_exclude_{{$.AclName}}{{.Port}}_{{.Index}}{{end}}{{if .ServiceDomain}} domain_{{$.AclName}}{{.Port}}_{{.Index}}{{end}} https_{{$.ServiceName}}_{{.Index}}
6363
{{- end}}
6464
{{- $length := len .UserAgent.Value}}{{if gt $length 0}} user_agent_{{$.AclName}}_{{.UserAgent.AclName}}_{{.Index}}{{end}}
@@ -292,7 +292,7 @@ backend {{$.AclName}}-be{{.Port}}_{{.Index}}
292292
{{ $.BackendExtra }}
293293
{{- end}}
294294
{{- range $sd := .ServiceDest}}
295-
{{- if gt $.HttpsPort 0}}
295+
{{- if gt $sd.HttpsPort 0}}
296296
backend https-{{$.AclName}}-be{{.Port}}_{{.Index}}
297297
mode {{.ReqModeFormatted}}
298298
{{- if eq .ReqModeFormatted "http"}}
@@ -332,13 +332,13 @@ backend https-{{$.AclName}}-be{{.Port}}_{{.Index}}
332332
cookie {{$.ServiceName}} insert indirect nocache
333333
{{- end}}
334334
{{- range $i, $t := $.Tasks}}
335-
server {{$.ServiceName}}_{{$i}} {{$t}}:{{$.HttpsPort}} check cookie {{$.ServiceName}}_{{$i}}{{if eq $sd.SslVerifyNone true}} ssl verify none{{end}}
335+
server {{$.ServiceName}}_{{$i}} {{$t}}:{{$sd.HttpsPort}} check cookie {{$.ServiceName}}_{{$i}}{{if eq $sd.SslVerifyNone true}} ssl verify none{{end}}
336336
{{- end}}
337337
{{- if not $.Tasks}}
338338
{{- if eq $.DiscoveryType "DNS"}}
339-
server-template {{$.ServiceName}} {{$.Replicas}} {{if eq $sd.OutboundHostname ""}}{{$.ServiceName}}{{end}}{{if ne $sd.OutboundHostname ""}}{{$sd.OutboundHostname}}{{end}}:{{$.HttpsPort}} check{{if eq $.CheckResolvers true}} resolvers docker{{end}}{{if eq $sd.SslVerifyNone true}} ssl verify none{{end}}
339+
server-template {{$.ServiceName}} {{$.Replicas}} {{if eq $sd.OutboundHostname ""}}{{$.ServiceName}}{{end}}{{if ne $sd.OutboundHostname ""}}{{$sd.OutboundHostname}}{{end}}:{{$sd.HttpsPort}} check{{if eq $.CheckResolvers true}} resolvers docker{{end}}{{if eq $sd.SslVerifyNone true}} ssl verify none{{end}}
340340
{{- else }}
341-
server {{$.ServiceName}} {{if eq $sd.OutboundHostname ""}}{{$.ServiceName}}{{end}}{{if ne $sd.OutboundHostname ""}}{{$sd.OutboundHostname}}{{end}}:{{$.HttpsPort}}{{if eq $.CheckResolvers true}} check resolvers docker{{end}}{{if eq $sd.SslVerifyNone true}} ssl verify none{{end}}
341+
server {{$.ServiceName}} {{if eq $sd.OutboundHostname ""}}{{$.ServiceName}}{{end}}{{if ne $sd.OutboundHostname ""}}{{$sd.OutboundHostname}}{{end}}:{{$sd.HttpsPort}}{{if eq $.CheckResolvers true}} check resolvers docker{{end}}{{if eq $sd.SslVerifyNone true}} ssl verify none{{end}}
342342
{{- end}}
343343
{{- end}}
344344
{{- if not .IgnoreAuthorization}}

proxy/types.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ type ServiceDest struct {
2525
DenyHttp bool
2626
// Whether to redirect all http requests to https
2727
HttpsOnly bool
28+
// The internal HTTPS port of a service that should be reconfigured.
29+
// The port is used only in the swarm mode.
30+
// If not specified, the `port` parameter will be used instead.
31+
HttpsPort int
2832
// HTTP code for HTTP to HTTPS redirects. This parameter is used only if `httpsOnly` is set to `true`.
2933
HttpsRedirectCode string
3034
// Whether to ignore authorization for this service destination.
@@ -141,10 +145,6 @@ type Service struct {
141145
// Whether to distribute a request to all the instances of the proxy.
142146
// Used only in the swarm mode.
143147
Distribute bool `split_words:"true"`
144-
// The internal HTTPS port of a service that should be reconfigured.
145-
// The port is used only in the swarm mode.
146-
// If not specified, the `port` parameter will be used instead.
147-
HttpsPort int `split_words:"true"`
148148
// If set to true, it will be the default_backend service.
149149
IsDefaultBackend bool `split_words:"true"`
150150
// The ACL derivative. Defaults to path_beg.
@@ -312,9 +312,6 @@ func GetServiceFromProvider(provider ServiceParameterProvider) *Service {
312312
if strings.EqualFold(provider.GetString("serviceDomainMatchAll"), "true") {
313313
sr.ServiceDomainAlgo = "hdr_dom(host)"
314314
}
315-
if len(provider.GetString("httpsPort")) > 0 {
316-
sr.HttpsPort, _ = strconv.Atoi(provider.GetString("httpsPort"))
317-
}
318315
if len(provider.GetString("addReqHeader")) > 0 {
319316
sr.AddReqHeader = strings.Split(provider.GetString("addReqHeader"), separator)
320317
} else if len(provider.GetString("addHeader")) > 0 { // TODO: Deprecated since Apr. 2017.
@@ -408,6 +405,7 @@ func getServiceDest(sr *Service, provider ServiceParameterProvider, index int) S
408405
reqMode = "http"
409406
}
410407
srcPort, _ := strconv.Atoi(getFromString(provider, "srcPort", suffix))
408+
httpsPort, _ := strconv.Atoi(getFromString(provider, "httpsPort", suffix))
411409
headerString := getFromString(provider, "serviceHeader", suffix)
412410
header := map[string]string{}
413411
if len(headerString) > 0 {
@@ -445,6 +443,7 @@ func getServiceDest(sr *Service, provider ServiceParameterProvider, index int) S
445443
DeniedMethods: getSliceFromString(provider, "deniedMethods", suffix),
446444
DenyHttp: getBoolParam(provider, "denyHttp", suffix),
447445
HttpsOnly: getBoolParam(provider, "httpsOnly", suffix),
446+
HttpsPort: httpsPort,
448447
HttpsRedirectCode: getFromString(provider, "httpsRedirectCode", suffix),
449448
IgnoreAuthorization: getBoolParam(provider, "ignoreAuthorization", suffix),
450449
OutboundHostname: getFromString(provider, "outboundHostname", suffix),

proxy/types_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,6 @@ func (s *TypesTestSuite) getServiceMap(expected Service, indexSuffix, separator
372372
"delReqHeader": strings.Join(expected.DelReqHeader, separator),
373373
"delResHeader": strings.Join(expected.DelResHeader, separator),
374374
"distribute": strconv.FormatBool(expected.Distribute),
375-
"httpsPort": strconv.Itoa(expected.HttpsPort),
376375
"isDefaultBackend": strconv.FormatBool(expected.IsDefaultBackend),
377376
"pathType": expected.PathType,
378377
"redirectWhenHttpProto": strconv.FormatBool(expected.RedirectWhenHttpProto),
@@ -396,6 +395,7 @@ func (s *TypesTestSuite) getServiceMap(expected Service, indexSuffix, separator
396395
"deniedMethods" + indexSuffix: strings.Join(expected.ServiceDest[0].DeniedMethods, separator),
397396
"denyHttp" + indexSuffix: strconv.FormatBool(expected.ServiceDest[0].DenyHttp),
398397
"httpsOnly" + indexSuffix: strconv.FormatBool(expected.ServiceDest[0].HttpsOnly),
398+
"httpsPort" + indexSuffix: strconv.Itoa(expected.ServiceDest[0].HttpsPort),
399399
"httpsRedirectCode" + indexSuffix: expected.ServiceDest[0].HttpsRedirectCode,
400400
"ignoreAuthorization" + indexSuffix: strconv.FormatBool(expected.ServiceDest[0].IgnoreAuthorization),
401401
"outboundHostname" + indexSuffix: expected.ServiceDest[0].OutboundHostname,
@@ -427,7 +427,6 @@ func (s *TypesTestSuite) getExpectedService() Service {
427427
DelReqHeader: []string{"del-header-1", "del-header-2"},
428428
DelResHeader: []string{"del-header-1", "del-header-2"},
429429
Distribute: true,
430-
HttpsPort: 1234,
431430
IsDefaultBackend: true,
432431
PathType: "pathType",
433432
RedirectWhenHttpProto: true,
@@ -443,6 +442,7 @@ func (s *TypesTestSuite) getExpectedService() Service {
443442
DeniedMethods: []string{"PUT", "POST"},
444443
DenyHttp: true,
445444
HttpsOnly: true,
445+
HttpsPort: 1234,
446446
HttpsRedirectCode: "302",
447447
IgnoreAuthorization: true,
448448
OutboundHostname: "outboundHostname",

server/server.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ func (m *serve) getServiceFromEnvVars(prefix string) (proxy.Service, error) {
256256
reqMode = getSecretOrEnvVar("DEFAULT_PROTOCOL", "http")
257257
}
258258
httpsOnly, _ := strconv.ParseBool(os.Getenv(prefix + "_HTTPS_ONLY"))
259+
httpsPort, _ := strconv.Atoi(os.Getenv(prefix + "_HTTPS_PORT"))
259260
httpsRedirectCode := os.Getenv(prefix + "_HTTPS_REDIRECT_CODE")
260261
globalOutboundHostname := os.Getenv(prefix + "_OUTBOUND_HOSTNAME")
261262
reqPathSearchReplace := os.Getenv(prefix + "_REQ_PATH_SEARCH_REPLACE")
@@ -282,6 +283,7 @@ func (m *serve) getServiceFromEnvVars(prefix string) (proxy.Service, error) {
282283
DeniedMethods: deniedMethods,
283284
DenyHttp: denyHTTP,
284285
HttpsOnly: httpsOnly,
286+
HttpsPort: httpsPort,
285287
HttpsRedirectCode: httpsRedirectCode,
286288
IgnoreAuthorization: ignoreAuthorization,
287289
OutboundHostname: globalOutboundHostname,

server/server_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,6 @@ func (s *ServerTestSuite) Test_GetServiceFromUrl_ReturnsProxyService() {
529529
DelResHeader: []string{"add-header-1", "add-header-2"},
530530
DiscoveryType: "DNS",
531531
Distribute: true,
532-
HttpsPort: 1234,
533532
PathType: "pathType",
534533
RedirectWhenHttpProto: true,
535534
Replicas: 83,
@@ -543,6 +542,7 @@ func (s *ServerTestSuite) Test_GetServiceFromUrl_ReturnsProxyService() {
543542
Clitcpka: true,
544543
DeniedMethods: []string{"PUT", "POST"},
545544
HttpsOnly: true,
545+
HttpsPort: 1234,
546546
HttpsRedirectCode: "302",
547547
OutboundHostname: "outboundHostname",
548548
Port: "1234",
@@ -593,7 +593,7 @@ func (s *ServerTestSuite) Test_GetServiceFromUrl_ReturnsProxyService() {
593593
expected.ServiceDest[0].HttpsRedirectCode,
594594
expected.IsDefaultBackend,
595595
expected.RedirectWhenHttpProto,
596-
expected.HttpsPort,
596+
expected.ServiceDest[0].HttpsPort,
597597
strings.Join(expected.ServiceDest[0].ServiceDomain, ","),
598598
strings.Join(expected.ServiceDest[0].RedirectFromDomain, ","),
599599
expected.Distribute,
@@ -685,7 +685,6 @@ func (s *ServerTestSuite) Test_GetServicesFromEnvVars_ReturnsServices() {
685685
DelReqHeader: []string{"del-header-1", "del-header-2"},
686686
DelResHeader: []string{"del-header-1", "del-header-2"},
687687
Distribute: true,
688-
HttpsPort: 1234,
689688
IsDefaultBackend: true,
690689
PathType: "my-PathType",
691690
RedirectWhenHttpProto: true,
@@ -699,6 +698,7 @@ func (s *ServerTestSuite) Test_GetServicesFromEnvVars_ReturnsServices() {
699698
ServiceDest: []proxy.ServiceDest{
700699
{
701700
HttpsOnly: true,
701+
HttpsPort: 1234,
702702
HttpsRedirectCode: "302",
703703
IgnoreAuthorization: true,
704704
OutboundHostname: "my-OutboundHostname",
@@ -736,7 +736,7 @@ func (s *ServerTestSuite) Test_GetServicesFromEnvVars_ReturnsServices() {
736736
os.Setenv("DFP_SERVICE_DISTRIBUTE", strconv.FormatBool(service.Distribute))
737737
os.Setenv("DFP_SERVICE_HTTPS_ONLY", strconv.FormatBool(service.ServiceDest[0].HttpsOnly))
738738
os.Setenv("DFP_SERVICE_HTTPS_REDIRECT_CODE", service.ServiceDest[0].HttpsRedirectCode)
739-
os.Setenv("DFP_SERVICE_HTTPS_PORT", strconv.Itoa(service.HttpsPort))
739+
os.Setenv("DFP_SERVICE_HTTPS_PORT", strconv.Itoa(service.ServiceDest[0].HttpsPort))
740740
os.Setenv("DFP_SERVICE_IGNORE_AUTHORIZATION", strconv.FormatBool(service.ServiceDest[0].IgnoreAuthorization))
741741
os.Setenv("DFP_SERVICE_IS_DEFAULT_BACKEND", strconv.FormatBool(service.IsDefaultBackend))
742742
os.Setenv("DFP_SERVICE_OUTBOUND_HOSTNAME", service.ServiceDest[0].OutboundHostname)

0 commit comments

Comments
 (0)