rintaro/Plack-Middleware-CSRFBlock — pull request #4 by throughnothing (2012-09-04 20:47:08+00:00)
Title: Meta tag and headers

This adds the ability (disabled by default) to add a meta-tag to your html `

` with the `content` containing the csrf token. The intention for this is that it can be grabbed by javascript, and used to send a `X-CSRF-Token` header with all ajax requests (easy to add to *all* ajax requests with jquery, for example).

I've also modified this middleware to accept the `X-CSRF-Token` header on `POST` requests so that you can either send the correct form parameter with a form, *or* you can send the `X-CSRF-Token` with any ajax/form request to have the post work correctly.