lib/cloudfiles/authentication.rb in cloudfiles-1.4.0 vs lib/cloudfiles/authentication.rb in cloudfiles-1.4.1

- old
+ new

@@ -24,19 +24,29 @@ if (response.code == "204") connection.cdnmgmthost = URI.parse(response["x-cdn-management-url"]).host connection.cdnmgmtpath = URI.parse(response["x-cdn-management-url"]).path connection.cdnmgmtport = URI.parse(response["x-cdn-management-url"]).port connection.cdnmgmtscheme = URI.parse(response["x-cdn-management-url"]).scheme - connection.storagehost = URI.parse(response["x-storage-url"]).host + connection.storagehost = set_snet(connection,URI.parse(response["x-storage-url"]).host) connection.storagepath = URI.parse(response["x-storage-url"]).path connection.storageport = URI.parse(response["x-storage-url"]).port connection.storagescheme = URI.parse(response["x-storage-url"]).scheme connection.authtoken = response["x-auth-token"] connection.authok = true else connection.authtoken = false raise AuthenticationException, "Authentication failed" end server.finish + end + + private + + def set_snet(connection,hostname) + if connection.snet? + "snet-#{hostname}" + else + hostname + end end end end \ No newline at end of file