weavejester/ring-anti-forgery — pull request #8 by jszakmeister (2012-05-04 20:46:43+00:00)
Title: Reduce token size to avoid linefeeds in the data.

32 bytes of random data is plenty, and keep us from the 57 byte
limit where BASE64Encoder will split the base 64 line and insert
a linefeed. This was causing issues in Google Chrome as the linefeed
would get converted into a space and cause the comparison with the
hidden field to fail.

I opened a ticket for this (#7), but I figured it was best to put something
together and push it up. I have an alternate implementation that uses
the same size token, but also introduces a dependency on
``clojure.data.codec.base64``. In the end, I thought this was the best
solution since it avoids an extra dependency, and there's still enough
random data to prevent forged requests.