# File lib/gh/token_check.rb, line 16 def check_token return unless @check_token and client_id and client_secret and token @check_token = false auth_header = "Basic %s" % Base64.encode64("#{client_id}:#{client_secret}").gsub("\n", "") http :head, path_for("/applications/#{client_id}/tokens/#{token}?client_id=#{client_id}&client_secret=#{client_secret}"), "Authorization" => auth_header rescue GH::Error(:response_status => 404) => error raise GH::TokenInvalid, error end