Skip to content

Commit

Permalink
Merge pull request #214 from digitalocean/mregmi/add_proxy_protocol
Browse files Browse the repository at this point in the history
add support for enable_proxy_protocol
  • Loading branch information
mregmi authored Mar 18, 2019
2 parents 7a99fd7 + f829cd4 commit 5a9a614
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions load_balancers.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type LoadBalancer struct {
Tag string `json:"tag,omitempty"`
Tags []string `json:"tags,omitempty"`
RedirectHttpToHttps bool `json:"redirect_http_to_https,omitempty"`
EnableProxyProtocol bool `json:"enable_proxy_protocol,omitempty"`
}

// String creates a human-readable description of a LoadBalancer.
Expand All @@ -63,6 +64,7 @@ func (l LoadBalancer) AsRequest() *LoadBalancerRequest {
DropletIDs: append([]int(nil), l.DropletIDs...),
Tag: l.Tag,
RedirectHttpToHttps: l.RedirectHttpToHttps,
EnableProxyProtocol: l.EnableProxyProtocol,
HealthCheck: l.HealthCheck,
}

Expand Down Expand Up @@ -135,6 +137,7 @@ type LoadBalancerRequest struct {
Tag string `json:"tag,omitempty"`
Tags []string `json:"tags,omitempty"`
RedirectHttpToHttps bool `json:"redirect_http_to_https,omitempty"`
EnableProxyProtocol bool `json:"enable_proxy_protocol,omitempty"`
}

// String creates a human-readable description of a LoadBalancerRequest.
Expand Down
2 changes: 2 additions & 0 deletions load_balancers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,7 @@ func TestLoadBalancers_AsRequest(t *testing.T) {
Slug: "lon1",
},
RedirectHttpToHttps: true,
EnableProxyProtocol: true,
}
lb.DropletIDs = make([]int, 1, 2)
lb.DropletIDs[0] = 12345
Expand Down Expand Up @@ -861,6 +862,7 @@ func TestLoadBalancers_AsRequest(t *testing.T) {
},
DropletIDs: []int{12345},
RedirectHttpToHttps: true,
EnableProxyProtocol: true,
}

r := lb.AsRequest()
Expand Down

0 comments on commit 5a9a614

Please sign in to comment.