Skip to content

Bug/1 server decode #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/openid/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ def initialize(server)
# Raises ProtocolError when the query does not seem to be a valid
# OpenID request.
def decode(query)
if query.nil? or query.length == 0
if query.nil? or query.empty?
return nil
end

Expand Down
6 changes: 3 additions & 3 deletions test/test_cryptutil.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ class CryptUtilTestCase < Minitest::Test

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

# It's possible that these will be small enough for fixnums, but
# extraorindarily unlikely.
a = OpenID::CryptUtil.rand(BIG)
b = OpenID::CryptUtil.rand(BIG)
assert(a.is_a?(Bignum))
assert(b.is_a?(Bignum))
assert(a.is_a?(Integer))
assert(b.is_a?(Integer))
refute_equal(a, b)
end

Expand Down