lib/QuickBaseClient.rb in quickbase_client-1.0.23 vs lib/QuickBaseClient.rb in quickbase_client-1.0.24
- old
+ new
@@ -1016,12 +1016,13 @@
@realm = nil
if USING_HTTPCLIENT
begin
httpclient = HTTPClient.new
resp = httpclient.get("https://www.quickbase.com/db/#{dbid}")
- @realm = resp.header['Location'][0]
- @realm.sub!("https://","")
- @realm.sub!(".quickbase.com/db/#{dbid}","")
+ location = resp.header['Location'][0]
+ location.sub!("https://","")
+ parts = location.split(/\./)
+ @realm = parts[0]
rescue StandardError => error
@realm = nil
end
else
raise "Please get the HTTPClient gem: gem install httpclient"