pgericson/zendesk-api — Issue #15: main.rb should set curl.http_auth_types
Author: smparkes
Created: 2012-03-07 03:21:13+00:00
State: open

Setting curl.http_auth_types, e.g.,

curl.userpwd = "#{@username}:#{@password}"
curl.http_auth_types = :basic

causes curl to emit the basic auth header right away when making a connection, rather than waiting for a 401. This both reduces traffic (since everything doesn't take two handshakes) and works around what looks to be like a zendesk issue where they sometimes 401 the request without giving the auth/basic header in the response (when curl see this, it just 401's the whole thing rather than trying to send basic.)