ftw 0.0.24 → 0.0.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/ftw/request.rb +5 -0
  2. data/lib/ftw/version.rb +1 -1
  3. metadata +4 -4
data/lib/ftw/request.rb CHANGED
@@ -6,6 +6,7 @@ require "ftw/namespace"
6
6
  require "ftw/response"
7
7
  require "ftw/protocol"
8
8
  require "uri" # ruby stdlib
9
+ require "base64" # ruby stdlib
9
10
 
10
11
  # An HTTP Request.
11
12
  #
@@ -104,6 +105,10 @@ class FTW::Request
104
105
 
105
106
  # TODO(sissel): Use uri.password and uri.user to set Authorization basic
106
107
  # stuff.
108
+ if uri.password || uri.user
109
+ encoded = Base64.strict_encode64("#{uri.user}:#{uri.password}")
110
+ @headers.set("Authorization", "Basic #{encoded}")
111
+ end
107
112
  # uri.password
108
113
  # uri.user
109
114
  @request_uri = uri.path
data/lib/ftw/version.rb CHANGED
@@ -3,5 +3,5 @@ require "ftw/namespace"
3
3
  # :nodoc:
4
4
  module FTW
5
5
  # The version of this library
6
- VERSION = "0.0.24"
6
+ VERSION = "0.0.25"
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ftw
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.24
4
+ version: 0.0.25
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-27 00:00:00.000000000 Z
12
+ date: 2012-11-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -69,13 +69,13 @@ dependencies:
69
69
  requirements:
70
70
  - - ~>
71
71
  - !ruby/object:Gem::Version
72
- version: 2.2.6
72
+ version: 2.3.2
73
73
  none: false
74
74
  requirement: !ruby/object:Gem::Requirement
75
75
  requirements:
76
76
  - - ~>
77
77
  - !ruby/object:Gem::Version
78
- version: 2.2.6
78
+ version: 2.3.2
79
79
  none: false
80
80
  prerelease: false
81
81
  type: :runtime