lib/vmc/client.rb in af-0.3.18.11 vs lib/vmc/client.rb in af-0.3.18.12

- old
+ new

@@ -380,11 +380,16 @@ info = infras.detect { |i| i[:infra] == name } info ? info[:base] : default_base end def default_base - return "vcap.me" if @target =~ /https?:\/\/api.vcap.me/ - "aws.af.cm" + # remove the protocol, and the first component of the url, which is normally api + pattern = /https?:\/\/[^.]+\./ + if @target =~ pattern + @target.sub(pattern,'') + else + "aws.af.cm" + end end def infra_valid?(name) infras.detect { |i| i[:infra] == name } end