From 3dbdd21e70f712960968435d26995bd3dca847da Mon Sep 17 00:00:00 2001 From: mfo Date: Tue, 22 Jan 2013 11:32:45 +0100 Subject: [PATCH] change valid_token from class method to instance method --- lib/ruby_picasa.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ruby_picasa.rb b/lib/ruby_picasa.rb index 5832cb0..3b3ccbc 100644 --- a/lib/ruby_picasa.rb +++ b/lib/ruby_picasa.rb @@ -93,10 +93,12 @@ def authorize_request(request) # Takes a SubAuthToken and verify if it's still valid # see: https://developers.google.com/accounts/docs/AuthSub?hl=fr#AuthSubTokenInfo - def self.valid_token?(token) + def valid_token?(token) + @token = token + http = Net::HTTP.new("www.google.com", 443) http.use_ssl = true - response = http.get('/accounts/AuthSubTokenInfo', { "Authorization" => %{AuthSub token="#{ token }"} }) + response = http.get('/accounts/AuthSubTokenInfo', auth_header) response.status.to_s == "200" end