Skip to content

Commit 1f24002

Browse files
authored
Merge pull request #2 from VitalConnectInc/bug/1-server-decode
Bug/1 server decode
2 parents 26b8227 + c4bb12f commit 1f24002

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/openid/server.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,7 @@ def initialize(server)
12401240
# Raises ProtocolError when the query does not seem to be a valid
12411241
# OpenID request.
12421242
def decode(query)
1243-
if query.nil? or query.length == 0
1243+
if query.nil? or query.empty?
12441244
return nil
12451245
end
12461246

test/test_cryptutil.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ class CryptUtilTestCase < Minitest::Test
88

99
def test_rand
1010
# If this is not true, the rest of our test won't work
11-
assert(BIG.is_a?(Bignum))
11+
assert(BIG.is_a?(Integer))
1212

1313
# It's possible that these will be small enough for fixnums, but
1414
# extraorindarily unlikely.
1515
a = OpenID::CryptUtil.rand(BIG)
1616
b = OpenID::CryptUtil.rand(BIG)
17-
assert(a.is_a?(Bignum))
18-
assert(b.is_a?(Bignum))
17+
assert(a.is_a?(Integer))
18+
assert(b.is_a?(Integer))
1919
refute_equal(a, b)
2020
end
2121

0 commit comments

Comments
 (0)