Skip to content

Commit

Permalink
Ensure port from config is an integer when checking its validity
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Anderson authored and hashrocketeer committed Sep 7, 2012
1 parent 7d48840 commit 510abbf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -61,7 +61,7 @@ else
# Heroku neo4j add-on
Keymaker.configure do |c|
c.server = ENV['NEO4J_HOST']
c.port = ENV['NEO4J_PORT'].to_i
c.port = ENV['NEO4J_PORT']
c.username = ENV['NEO4J_LOGIN']
c.password = ENV['NEO4J_PASSWORD']
end
Expand Down
2 changes: 1 addition & 1 deletion lib/keymaker/service.rb
Expand Up @@ -115,7 +115,7 @@ def put(url, body)

def parse_url(url)
connection.build_url(url).tap do |uri|
if uri.port != config.port
if uri.port != Integer(config.port)
raise RuntimeError, "bad port"
end
end
Expand Down

0 comments on commit 510abbf

Please sign in to comment.