oauth2-rails2 0.0.13c → 0.0.13d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/oauth2/client.rb +6 -9
- data/oauth2-rails2.gemspec +1 -1
- metadata +3 -3
data/lib/oauth2/client.rb
CHANGED
@@ -62,6 +62,7 @@ module OAuth2
|
|
62
62
|
else
|
63
63
|
resp = connection.run_request(verb, url, params, headers)
|
64
64
|
end
|
65
|
+
|
65
66
|
case resp.status
|
66
67
|
when 200..201
|
67
68
|
if json?
|
@@ -74,19 +75,15 @@ module OAuth2
|
|
74
75
|
ResponseString.new(resp)
|
75
76
|
end
|
76
77
|
when 301..302
|
77
|
-
|
78
|
-
begin
|
79
|
-
ResponseHash.new(resp)
|
80
|
-
rescue StandardError => e
|
81
|
-
ResponseString.new(resp)
|
82
|
-
end
|
83
|
-
else
|
84
|
-
ResponseString.new(resp)
|
85
|
-
end
|
78
|
+
self.request(verb, resp.headers['location'], params, headers)
|
86
79
|
when 401
|
87
80
|
e = OAuth2::AccessDenied.new("Received HTTP 401 during request.")
|
88
81
|
e.response = resp
|
89
82
|
raise e
|
83
|
+
when 404
|
84
|
+
e = OAuth2::HTTPError.new("Received HTTP #{resp.status} during request.")
|
85
|
+
e.response = resp
|
86
|
+
raise e
|
90
87
|
when 500
|
91
88
|
e = OAuth2::HTTPError.new("Received HTTP #{resp.status} during request.")
|
92
89
|
e.response = resp
|
data/oauth2-rails2.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oauth2-rails2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 420914393
|
5
5
|
prerelease: true
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 13d
|
10
|
+
version: 0.0.13d
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Michael Bleigh
|