• S
    Accept and default to base64_urlsafe CSRF tokens (#18496) · dabb587c
    Scott Blum 提交于
    Base64 strict-encoded CSRF tokens are not inherently websafe, which makes
    them difficult to deal with. For example, the common practice of sending
    the CSRF token to a browser in a client-readable cookie does not work properly
    out of the box: the value has to be url-encoded and decoded to survive transport.
    
    Now, we generate Base64 urlsafe-encoded CSRF tokens, which are inherently safe
    to transport.  Validation accepts both urlsafe tokens, and strict-encoded tokens
    for backwards compatibility.
    dabb587c
request_forgery_protection_test.rb 33.0 KB