Skip to content

Commit

Permalink
Updated Changelog, LICENSE and README.
Browse files Browse the repository at this point in the history
  • Loading branch information
baldowl committed Feb 28, 2012
1 parent 38cabc0 commit 3cbb7d4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 14 deletions.
13 changes: 13 additions & 0 deletions Changelog.md
@@ -1,3 +1,16 @@
# v2.4.0 (2012-02-28)

* Updated examples' Gemfiles.
* Dependency management is entrusted totally to Bundler.
* Added support for CSRF validation via request headers (courtesy of
[jeffreyiacono](https://github.com/jeffreyiacono)).
* Improved a bit documentation and testing code.
* New option :skip_if (courtesy of
[jakubpawlowicz](https://github.com/jakubpawlowicz) and
[GoalSmashers](https://github.com/GoalSmashers)).



# v2.3.0 (2011-10-23)

* Updated examples' Gemfiles.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.rdoc
Expand Up @@ -2,7 +2,7 @@

(The MIT License)

Copyright (c) 2009, 2010, 2011 Emanuele Vicentini
Copyright (c) 2009, 2010, 2011, 2012 Emanuele Vicentini

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the 'Software'), to deal
Expand Down
25 changes: 12 additions & 13 deletions README.rdoc
Expand Up @@ -98,22 +98,21 @@ The following options allow you to tweak Rack::Csrf.
Default value: csrf.token

[<tt>:header</tt>]
Default header name (see below) is <tt>X_CSRF_TOKEN</tt>; you can adapt it to
specific needs.
Default header name (see below) is <tt>X_CSRF_TOKEN</tt>; you can adapt it
to specific needs.

use Rack::Csrf, :header => 'MY_CSRF_TOKEN_HEADER'

This is useful if we want to configure our application to send the csrf
token in all of our ajax requests via a header. We could implement something
This is useful if we want to configure our application to send the CSRF
token in all of our AJAX requests via a header. We could implement something
along the lines of the following:

(function(jQuery) {
/**
* Set the csrf token for each ajax operation,
* rack / rack_csrf handle the rest.
* Assumes your layout has a metatag with name of "_csrf" and you're using
* the default Rack:Csrf header setup.
*/
/*
* Set the CSRF token for each AJAX request, Rack::Csrf handle the rest.
* Assumes your layout has a metatag with name of "_csrf" and you're
* using the default Rack:Csrf header setup.
*/
jQuery.ajaxSetup({
beforeSend: function(xhr) {
var token = jQuery('meta[name="_csrf"]').attr('content');
Expand Down Expand Up @@ -176,8 +175,8 @@ token.
insert the token in a standard metatag within your layout's head with the
right value already entered for you.

<tt>options</tt> is an optional hash that can currently take a +name+ setting, which
will alter the metatag's name attribute.
<tt>options</tt> is an optional hash that can currently take a +name+
setting, which will alter the metatag's name attribute.

Default name: _csrf

Expand Down Expand Up @@ -209,5 +208,5 @@ forgo responsibilities for keeping your application as safe as possible.

== Copyright

Copyright (c) 2009, 2010, 2011 Emanuele Vicentini. See LICENSE.rdoc for
Copyright (c) 2009, 2010, 2011, 2012 Emanuele Vicentini. See LICENSE.rdoc for
details.

0 comments on commit 3cbb7d4

Please sign in to comment.