Permalink
Browse files

Removed a class method from the public API.

  • Loading branch information...
1 parent 6dbd4e2 commit cec9e5da84494be06a076947a095d1cbda3147d1 @baldowl committed Feb 18, 2012
Showing with 14 additions and 11 deletions.
  1. +6 −5 lib/rack/csrf.rb
  2. +8 −6 spec/csrf_spec.rb
View
@@ -60,10 +60,6 @@ def self.header
@@header
end
- def self.rackified_header
- "HTTP_#{@@header.gsub('-','_').upcase}"
- end
-
def self.token(env)
env['rack.session'][key] ||= SecureRandom.base64(32)
end
@@ -88,7 +84,12 @@ class << self
protected
- # Return +true+ if the given request appears in the <b>skip list</b> or
+ # Returns the custom header's name adapted to current standards.
+ def self.rackified_header
+ "HTTP_#{@@header.gsub('-','_').upcase}"
+ end
+
+ # Returns +true+ if the given request appears in the <b>skip list</b> or
# the <b>conditional skipping code</b> return true or, when the <b>check
# only list</b> is not empty (i.e., we are working in the "reverse mode"
# triggered by the +check_only+ option), it does not appear in the
View
@@ -51,12 +51,6 @@
it { should == Rack::Csrf.method(:header) }
end
- describe 'rackified_header' do
- before { Rack::Csrf.new nil, :header => 'my-header' }
- subject { Rack::Csrf.rackified_header }
- it { should == 'HTTP_MY_HEADER'}
- end
-
describe 'token(env)' do
let(:env) { {'rack.session' => {}} }
@@ -171,6 +165,14 @@
end
end
+ # Protected/private API
+
+ describe 'rackified_header' do
+ before { Rack::Csrf.new nil, :header => 'my-header' }
+ subject { Rack::Csrf.rackified_header }
+ it { should == 'HTTP_MY_HEADER'}
+ end
+
describe 'skip_checking' do
let :request do
double 'Request',

0 comments on commit cec9e5d

Please sign in to comment.