taf2/curb — Issue #88: userpwd words but setting username and password individually doesn't, hmm
Author: ifightcrime
Created: 2011-10-23 01:56:55+00:00
State: open

Is there a reason why when using basic auth setting username and password separately doesn't work but using userpwd works fine?

I'm not sure why, but that's what's happening on my box.

centos 5
rvm ruby 1.9.2

Not a big deal because my workaround is obviously setting them together, but just though I would bring it to your attention.

ruby-1.9.2-p290 :002 > c = Curl::Easy.new("place") do |curl|
ruby-1.9.2-p290 :003 > curl.verbose = true
ruby-1.9.2-p290 :004?> end
=> #
ruby-1.9.2-p290 :005 > c.http_auth_types = :basic
=> :basic
ruby-1.9.2-p290 :006 > c.username = 'nick'
=> "nick"
ruby-1.9.2-p290 :007 > c.password = 'magicalpass'
=> "magicalpass"
ruby-1.9.2-p290 :008 > c.perform
* About to connect() to blahblah port 80
* Expire at 1319333700 / 554943 (300000ms)
* Trying ip... * Expire at 1319333700 / 555062 (300000ms)
* Expire at 1319333700 / 555102 (300000ms)
* Connected to omg (ip) port 80
> GET / HTTP/1.1
Host: goodness
Accept: */*

< HTTP/1.1 401 Authorization Required
< Date: Sun, 23 Oct 2011 01:30:00 GMT
< WWW-Authenticate: Basic realm="super place"
< Content-Length: 577
< Content-Type: text/html; charset=iso-8859-1