README.md in mta_json-0.0.1 vs README.md in mta_json-0.0.2
- old
+ new
@@ -1,10 +1,12 @@
# mta_json
Wraps MTA:SA's JSON format to support named parameters and different HTTP
methods with callRemote.
+See [Multi Theft Auto: San Andreas](http://mtasa.com/).
+
## Installation
Add this line to your application's Gemfile:
gem 'mta_json'
@@ -15,16 +17,26 @@
Or install it yourself as:
$ gem install mta_json
----
+## Configuration
-You'll need to add the following line to your `config/application.rb`:
+### Whitelist for POST, PUT and DELETE
- config.middleware.insert_before Rack::MethodOverride, MtaJson::Wrapper
+GET-requests are always processed.
+POST-, PUT- and DELETE-requests are handled via an ip whitelist. The only
+entry for this list is `127.0.0.1` per default.
+It can be **overwritten** with the following code in your `application.rb`:
+
+ config.mta_json.whitelist = %w(1.2.3.4 1.2.3.5)
+
+Or, to still allow requests from your local machine:
+
+ config.mta_json.whitelist = %w(1.2.3.4 1.2.3.5 127.0.0.1)
+
## Usage
### Rails
There are no changes required to any specific code, so long as your controller
@@ -120,11 +132,7 @@
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
## TODOs
-* Special care should be taken with the default POST method, there currently is
- no way to set a CSRF-Token. This can be worked around by using:
-
- <pre>skip_before_filter :verify_authenticity_token, :only => :your_method</pre>
-
-* The code doesn't insert itself as middleware automatically, see Installation section.
+* running rails behind a proxy/load balancer and IP resolution together with
+ the whitelist?