rest-graph 1.4.3 → 1.4.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +5 -0
- data/example/rails/test/unit/rails_util_test.rb +6 -0
- data/lib/rest-graph/rails_util.rb +15 -14
- data/lib/rest-graph/version.rb +1 -1
- metadata +3 -3
data/CHANGES
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
= rest-graph changes history
|
2
2
|
|
3
|
+
== rest-graph 1.4.4 -- 2010-08-06
|
4
|
+
|
5
|
+
* [RailsUtil] Fixed a bug that empty query appends a question mark,
|
6
|
+
that confuses Facebook, so that redirect_uri didn't match.
|
7
|
+
|
3
8
|
== rest-graph 1.4.3 -- 2010-08-06
|
4
9
|
|
5
10
|
* [RestGraph] Fixed a bug in RestGraph#fbs, which didn't join '&'.
|
@@ -29,4 +29,10 @@ class RailsUtilTest < ActiveSupport::TestCase
|
|
29
29
|
assert_equal('http://test.com/?lang=en',
|
30
30
|
RestGraph::RailsUtil.rest_graph_normalized_request_uri)
|
31
31
|
end
|
32
|
+
|
33
|
+
def test_rest_graph_normalized_request_uri_3
|
34
|
+
setup_mock( 'http://test.com/?code=123')
|
35
|
+
assert_equal('http://test.com/',
|
36
|
+
RestGraph::RailsUtil.rest_graph_normalized_request_uri)
|
37
|
+
end
|
32
38
|
end
|
@@ -49,8 +49,8 @@ module RestGraph::RailsUtil
|
|
49
49
|
# before, in that case, the fbs would be inside session,
|
50
50
|
# as we just saved it there
|
51
51
|
|
52
|
-
|
53
|
-
|
52
|
+
rest_graph_check_rg_session # prefered way to store fbs
|
53
|
+
rest_graph_check_rg_cookies # in canvas, session might not work..
|
54
54
|
end
|
55
55
|
|
56
56
|
# override this if you need different app_id and secret
|
@@ -151,8 +151,8 @@ module RestGraph::RailsUtil
|
|
151
151
|
" #{rest_graph.data.inspect}")
|
152
152
|
|
153
153
|
if rest_graph.authorized?
|
154
|
-
|
155
|
-
|
154
|
+
rest_graph_write_rg_session
|
155
|
+
rest_graph_write_rg_cookies
|
156
156
|
else
|
157
157
|
logger.warn(
|
158
158
|
"WARN: RestGraph: bad signed_request: #{params[:signed_request]}")
|
@@ -171,8 +171,8 @@ module RestGraph::RailsUtil
|
|
171
171
|
" #{rest_graph.data.inspect}")
|
172
172
|
|
173
173
|
if rest_graph.authorized?
|
174
|
-
|
175
|
-
|
174
|
+
rest_graph_write_rg_session
|
175
|
+
rest_graph_write_rg_cookies
|
176
176
|
else
|
177
177
|
logger.warn("WARN: RestGraph: bad session: #{params[:session]}")
|
178
178
|
end
|
@@ -190,35 +190,35 @@ module RestGraph::RailsUtil
|
|
190
190
|
"parsed: #{rest_graph.data.inspect}")
|
191
191
|
|
192
192
|
if rest_graph.authorized?
|
193
|
-
|
194
|
-
|
193
|
+
rest_graph_write_rg_session
|
194
|
+
rest_graph_write_rg_cookies
|
195
195
|
end
|
196
196
|
end
|
197
197
|
|
198
|
-
def
|
198
|
+
def rest_graph_check_rg_session
|
199
199
|
return if rest_graph.authorized? || !session['rest_graph_session']
|
200
200
|
rest_graph.parse_fbs!(session['rest_graph_session'])
|
201
|
-
logger.debug("DEBUG: RestGraph: detected session, parsed:" \
|
201
|
+
logger.debug("DEBUG: RestGraph: detected rest-graph session, parsed:" \
|
202
202
|
" #{rest_graph.data.inspect}")
|
203
203
|
end
|
204
204
|
|
205
|
-
def
|
205
|
+
def rest_graph_check_rg_cookies
|
206
206
|
return if rest_graph.authorized? || !cookies['rest_graph_cookies']
|
207
207
|
rest_graph.parse_fbs!(cookies['rest_graph_cookies'])
|
208
|
-
logger.debug("DEBUG: RestGraph: detected cookies, parsed:" \
|
208
|
+
logger.debug("DEBUG: RestGraph: detected rest-graph cookies, parsed:" \
|
209
209
|
" #{rest_graph.data.inspect}")
|
210
210
|
end
|
211
211
|
|
212
212
|
# ==================== others ================================
|
213
213
|
|
214
|
-
def
|
214
|
+
def rest_graph_write_rg_session
|
215
215
|
return if !rest_graph_oget(:write_session)
|
216
216
|
fbs = rest_graph.fbs
|
217
217
|
session['rest_graph_session'] = fbs
|
218
218
|
logger.debug("DEBUG: RestGraph: wrote session: fbs => #{fbs}")
|
219
219
|
end
|
220
220
|
|
221
|
-
def
|
221
|
+
def rest_graph_write_rg_cookies
|
222
222
|
return if !rest_graph_oget(:write_cookies)
|
223
223
|
fbs = rest_graph.fbs
|
224
224
|
cookies['rest_graph_cookies'] = fbs
|
@@ -249,6 +249,7 @@ module RestGraph::RailsUtil
|
|
249
249
|
uri.query = uri.query.split('&').reject{ |q|
|
250
250
|
q =~ /^(code|session)\=/
|
251
251
|
}.join('&') if uri.query
|
252
|
+
uri.query = nil if uri.query.blank?
|
252
253
|
}.to_s
|
253
254
|
end
|
254
255
|
|
data/lib/rest-graph/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rest-graph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 1.4.
|
9
|
+
- 4
|
10
|
+
version: 1.4.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Cardinal Blue
|