@@ -265,7 +265,7 @@ def handle_unverified_request
265
265
end
266
266
267
267
private
268
- class NullSessionHash < Rack ::Session ::Abstract ::SessionHash # :nodoc:
268
+ class NullSessionHash < Rack ::Session ::Abstract ::SessionHash
269
269
def initialize ( req )
270
270
super ( nil , req )
271
271
@data = { }
@@ -284,7 +284,7 @@ def enabled?
284
284
end
285
285
end
286
286
287
- class NullCookieJar < ActionDispatch ::Cookies ::CookieJar # :nodoc:
287
+ class NullCookieJar < ActionDispatch ::Cookies ::CookieJar
288
288
def write ( *)
289
289
# nothing
290
290
end
@@ -396,7 +396,7 @@ def verify_authenticity_token # :doc:
396
396
end
397
397
end
398
398
399
- def handle_unverified_request # :doc:
399
+ def handle_unverified_request
400
400
protection_strategy = forgery_protection_strategy . new ( self )
401
401
402
402
if protection_strategy . respond_to? ( :warning_message )
@@ -406,15 +406,14 @@ def handle_unverified_request # :doc:
406
406
protection_strategy . handle_unverified_request
407
407
end
408
408
409
- def unverified_request_warning_message # :nodoc:
409
+ def unverified_request_warning_message
410
410
if valid_request_origin?
411
411
"Can't verify CSRF token authenticity."
412
412
else
413
413
"HTTP Origin header (#{ request . origin } ) didn't match request.base_url (#{ request . base_url } )"
414
414
end
415
415
end
416
416
417
- # :nodoc:
418
417
CROSS_ORIGIN_JAVASCRIPT_WARNING = "Security warning: an embedded " \
419
418
"<script> tag on another site requested protected JavaScript. " \
420
419
"If you know what you're doing, go ahead and disable forgery " \
@@ -653,15 +652,15 @@ def normalize_relative_action_path(rel_action_path) # :doc:
653
652
uri . path . chomp ( "/" )
654
653
end
655
654
656
- def generate_csrf_token # :nodoc:
655
+ def generate_csrf_token
657
656
SecureRandom . urlsafe_base64 ( AUTHENTICITY_TOKEN_LENGTH )
658
657
end
659
658
660
- def encode_csrf_token ( csrf_token ) # :nodoc:
659
+ def encode_csrf_token ( csrf_token )
661
660
Base64 . urlsafe_encode64 ( csrf_token , padding : false )
662
661
end
663
662
664
- def decode_csrf_token ( encoded_csrf_token ) # :nodoc:
663
+ def decode_csrf_token ( encoded_csrf_token )
665
664
Base64 . urlsafe_decode64 ( encoded_csrf_token )
666
665
end
667
666
end
0 commit comments