Commit a3e72161 authored by Alex Tayts's avatar Alex Tayts
Browse files

simplify url template a bit

parent c6993d49
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -4,8 +4,8 @@
<%-
if 'resolve_to' in $url {
  $pattern = '^(?:(https?):\/\/)?(?:[^@\/\n]+@)?([^:\/\n]+):?(\d+)?.*'
  $replace = 'proto: \1:domain: \2:port: \3'
  $url_data = Hash(regsubst($url['url'], $pattern, $replace, 'IG').split(':').map |$x| { $x.strip() })
  $replace = 'proto:\1:domain:\2:port:\3:k:v'
  $url_data = Hash(regsubst($url['url'], $pattern, $replace, 'IG').split(':'))
  $domain = $url_data['domain']

  if $url_data['port'].empty {