Permalink
Browse files

Merge pull request #13 from caike/http_basic_auth

Set Authorization header with credentials.
  • Loading branch information...
2 parents 7d36a30 + 816b06c commit 4cb6213fcb8c591b62852f0439761c4c5e3bf5b0 @mattetti mattetti committed May 10, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/http.rb
View
1 lib/http.rb
@@ -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 4cb6213

Please sign in to comment.