diff options
author | Azul <azul@riseup.net> | 2016-12-02 11:36:02 +0100 |
---|---|---|
committer | Azul <azul@riseup.net> | 2016-12-02 11:36:02 +0100 |
commit | 65600992f5317ec8889428001313e36629b1e877 (patch) | |
tree | 300a84ac80dcc5f7151b000ceaaa18235d5591e5 /lib/nickserver/adapters/celluloid_http.rb | |
parent | 396b34a52aa7594866fda090f1329827488e98bc (diff) |
bugfix: use user:password@ prefix in http basic auth
http.rb does not do this on its own.
Diffstat (limited to 'lib/nickserver/adapters/celluloid_http.rb')
-rw-r--r-- | lib/nickserver/adapters/celluloid_http.rb | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/lib/nickserver/adapters/celluloid_http.rb b/lib/nickserver/adapters/celluloid_http.rb index 92c5c53..62f905f 100644 --- a/lib/nickserver/adapters/celluloid_http.rb +++ b/lib/nickserver/adapters/celluloid_http.rb @@ -1,28 +1,19 @@ -require 'nickserver/adapters' -require 'nickserver/config' +require 'nickserver/adapters/http' silence_warnings do require 'celluloid/io' end -require 'http' module Nickserver::Adapters - class CelluloidHttp + class CelluloidHttp < Http silence_warnings do include Celluloid::IO end - def get(url, options = {}) - response = HTTP.get url, - params: options[:query], - ssl_context: ctx, - ssl_socket_class: Celluloid::IO::SSLSocket - return response.code, response.to_s - end + protected - def ctx - OpenSSL::SSL::SSLContext.new.tap do |ctx| - ctx.ca_file = Nickserver::Config.hkp_ca_file - end + def default_options + super.merge ssl_socket_class: Celluloid::IO::SSLSocket end + end end |