Permalink
Browse files

Set Authorization header with credentials.

This allows for properly authenticating with APIs
that don't require encoded Basic Auth credentials,
like github.
  • Loading branch information...
1 parent ef429db commit 816b06ca9fbaa2a20cf882101e90ec2e2218caa8 @caike caike committed May 10, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/http.rb
View
@@ -174,6 +174,7 @@ def connection(connection, didReceiveData:received_data)
def connection(connection, willSendRequest:request, redirectResponse:redirect_response)
puts "HTTP redirected #{request.description}" #if SETTINGS[:debug]
new_request = request.mutableCopy
+ new_request.setValue(@credentials.inspect, forHTTPHeaderField:'Authorization')
@request.setAllHTTPHeaderFields(@headers) if @headers
# p @request.allHTTPHeaderFields.description
@connection.cancel

0 comments on commit 816b06c

Please sign in to comment.