Skip to content

Commit

Permalink
IPv6 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bczoma committed Mar 1, 2024
1 parent 9535183 commit 6d99f78
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/gen-template/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ locals {
slashSplit = split("/", var.url)
isIpV6HostPort = length(split("]", local.slashSplit[2])) == 2
hostPortSplit = local.isIpV6HostPort ? split("]:", trimprefix(local.slashSplit[2], "[")) : split(":", local.slashSplit[2])
host = local.hostPortSplit[0]
host = trimsuffix(local.hostPortSplit[0], "]")
port = length(local.hostPortSplit) == 2 ? tonumber(local.hostPortSplit[1]) : (local.tls ? 443 : 80)
path = "/${join("/", slice(local.slashSplit, 3, length(local.slashSplit)))}"
headers_list = tolist(var.request_headers)
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ locals {
slashSplit = split("/", var.url)
isIpV6HostPort = length(split("]", local.slashSplit[2])) == 2
hostPortSplit = local.isIpV6HostPort ? split("]:", trimprefix(local.slashSplit[2], "[")) : split(":", local.slashSplit[2])
host = local.hostPortSplit[0]
host = trimsuffix(local.hostPortSplit[0], "]")
port = length(local.hostPortSplit) == 2 ? tonumber(local.hostPortSplit[1]) : (local.tls ? 443 : 80)
path = "/${join("/", slice(local.slashSplit, 3, length(local.slashSplit)))}"
headers_list = tolist(var.request_headers)
Expand Down

0 comments on commit 6d99f78

Please sign in to comment.