Permalink
Browse files

Merge branch 'balexand-master'

  • Loading branch information...
2 parents 4e3f81b + 884881a commit 2503ef89e50c88bbe44ca2b7d98617a023b8977e @courtenay courtenay committed Feb 23, 2012
Showing with 10 additions and 2 deletions.
  1. +10 −2 lib/openid/store/memcache.rb
View
12 lib/openid/store/memcache.rb
@@ -63,7 +63,11 @@ def use_nonce(server_url, timestamp, salt)
ts = timestamp.to_s # base 10 seconds since epoch
nonce_key = key_prefix + 'N' + server_url + '|' + ts + '|' + salt
result = @cache_client.add(nonce_key, '', expiry(Nonce.skew + 5))
- return !!(result =~ /^STORED/)
+ if result.is_a? String
+ return !!(result =~ /^STORED/)
+ else
+ return result == true
+ end
end
def assoc_key(server_url, assoc_handle=nil)
@@ -87,7 +91,11 @@ def cleanup_associations
def delete(key)
result = @cache_client.delete(key)
- return !!(result =~ /^DELETED/)
+ if result.is_a? String
+ return !!(result =~ /^DELETED/)
+ else
+ return result == true
+ end
end
def serialize(assoc)

0 comments on commit 2503ef8

Please sign in to comment.