Permalink
Browse files

Changed username/password validation regexp so you can use a blank us…

…ername (useful when using the heroku API with an api key), fx


httparty -f xml -H "Accept: application/xml" -u :api_key https://api.heroku.com/apps/appname/ps
  • Loading branch information...
1 parent 8fe9fda commit 83c9aaa8e559976a256e8b778c0021d3b31d4eaa @guapolo guapolo committed Jan 22, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 bin/httparty
View
@@ -49,7 +49,7 @@ OptionParser.new do |o|
end
o.on("-u", "--user [CREDS]", "Use basic authentication. Value should be user:password") do |u|
- abort "Invalid credentials format. Must be user:password" unless u =~ /.+:.+/
+ abort "Invalid credentials format. Must be user:password" unless u =~ /.*:.+/
user, password = u.split(':')
opts[:basic_auth] = { :username => user, :password => password }
end

0 comments on commit 83c9aaa

Please sign in to comment.