Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Disable trans_sid if session_id is blank. Closes gh-23

Signed-off-by: Shin-ichiro OGAWA <rust.stnard+git@gmail.com>
  • Loading branch information...
commit cb17462d39ee46525006e605f422774fdc0f4b02 1 parent 50efdee
@rust rust authored
View
3  lib/jpmobile/trans_sid.rb
@@ -64,6 +64,9 @@ def transit_sid(*args)
private
# trans_sidを適用すべきかを返す。
def apply_trans_sid?
+ # session_id が blank の場合は適用しない
+ return false if trans_sid_mode and jpmobile_session_id.blank?
+
case trans_sid_mode
when :always
session.inspect
View
75 test/rails/overrides/spec/controllers/trans_sid_spec.rb
@@ -32,6 +32,11 @@
get :redirect
response.should redirect_to('/?_session_id=mysessionid')
end
+ it "でセッションIDが空のときには有効にならない" do
+ request.session_options[:id] = ""
+ get :link
+ response.body.should =~ %r{^<a href="/.+?/link">linkto</a>$}
+ end
end
describe TransSidBaseController, "という trans_sid が有効になっていないコントローラ" do
@@ -109,73 +114,3 @@ def describe_mobile_with_ua(user_agent, &block)
describe_mobile_with_ua "Vodafone/1.0/V903T/TJ001 Browser/VF-Browser/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 Ext-J-Profile/JSCL-1.2.2 Ext-V-Profile/VSCL-2.0.0" do
it_should_behave_like "trans_sid が起動しないとき"
end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Please sign in to comment.
Something went wrong with that request. Please try again.