Skip to content

Commit 04101f3

Browse files
committed
Better ELB handling
1 parent 7b54b83 commit 04101f3

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

proxy.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ func handleAWSRequest(req *http.Request, body []byte, respCode int) {
308308
}
309309
service = regexp.MustCompile(`(^Amazon|AWS\s*|\(.*|\s+|\W+)`).ReplaceAllString(service, "")
310310
if service == "ElasticLoadBalancing" || service == "ElasticLoadBalancingv2" {
311-
service = "ELBv2"
311+
service = "ELB"
312312
}
313313
} else {
314314
return
@@ -345,6 +345,14 @@ func handleAWSRequest(req *http.Request, body []byte, respCode int) {
345345
return
346346
}
347347
action = vals["Action"][0]
348+
if service == "ELB" && vals["Version"][0] != "2012-06-01" { // exception
349+
service = "ELBv2"
350+
for _, serviceDefinition := range serviceDefinitions {
351+
if serviceDefinition.Metadata.ServiceAbbreviation == "Elastic Load Balancing v2" {
352+
serviceDef = serviceDefinition
353+
}
354+
}
355+
}
348356

349357
if serviceDef.Operations[action].Input.Type == "structure" {
350358
for k, v := range vals {

0 commit comments

Comments
 (0)