oauth 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of oauth might be problematic. Click here for more details.

data/History.txt CHANGED
@@ -1,4 +1,8 @@
1
- == 0.2 2007-1-19 All together now release
1
+ == 0.2.2 2008-2-22 Lets actually support SSL release
2
+
3
+ It didn't actually use https when required.
4
+
5
+ == 0.2 2008-1-19 All together now release
2
6
 
3
7
  This is a big release, where we have merged the efforts of various parties into one common library. This means there are definitely some API changes you should be aware of. They should be minimal but please have a look at the unit tests.
4
8
 
@@ -1,4 +1,5 @@
1
1
  require 'net/http'
2
+ require 'net/https'
2
3
  require 'oauth/client/net_http'
3
4
  module OAuth
4
5
  class Consumer
@@ -70,7 +71,7 @@ module OAuth
70
71
  end
71
72
 
72
73
  def http
73
- @http ||= Net::HTTP.new(uri.host, uri.port)
74
+ @http ||= create_http
74
75
  end
75
76
 
76
77
  # will change
@@ -158,6 +159,13 @@ module OAuth
158
159
 
159
160
  protected
160
161
 
162
+ #Instantiates the http object
163
+ def create_http
164
+ http_object=Net::HTTP.new(uri.host, uri.port)
165
+ http_object.use_ssl = true if uri.scheme=="https"
166
+ http_object
167
+ end
168
+
161
169
  # create the http request object for a given http_method and path
162
170
  def create_http_request(http_method,path,*arguments)
163
171
  http_method=http_method.to_sym
@@ -168,8 +176,10 @@ module OAuth
168
176
  case http_method
169
177
  when :post
170
178
  request=Net::HTTP::Post.new(path,headers)
179
+ request["Content-Length"]=0 # Default to 0
171
180
  when :put
172
181
  request=Net::HTTP::Put.new(path,headers)
182
+ request["Content-Length"]=0 # Default to 0
173
183
  when :get
174
184
  request=Net::HTTP::Get.new(path,headers)
175
185
  when :delete
@@ -183,6 +193,7 @@ module OAuth
183
193
  request.set_form_data(data)
184
194
  elsif data
185
195
  request.body=data.to_s
196
+ request["Content-Length"]=request.body.length
186
197
  end
187
198
  request
188
199
  end
data/lib/oauth/version.rb CHANGED
@@ -2,7 +2,7 @@ module Oauth #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- TINY = 1
5
+ TINY = 2
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/website/index.html CHANGED
@@ -33,7 +33,7 @@
33
33
  <h1>Ruby OAuth GEM</h1>
34
34
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/oauth"; return false'>
35
35
  <p>Get Version</p>
36
- <a href="http://rubyforge.org/projects/oauth" class="numbers">0.2.0</a>
36
+ <a href="http://rubyforge.org/projects/oauth" class="numbers">0.2.2</a>
37
37
  </div>
38
38
  <h2>What</h2>
39
39
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pelle Braendgaard
@@ -12,7 +12,7 @@ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
14
 
15
- date: 2008-01-29 00:00:00 -08:00
15
+ date: 2008-02-22 00:00:00 -08:00
16
16
  default_executable:
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency