José Valim
312f433241
Clear DescendantsTracker on each request.
2010-06-19 17:51:44 +02:00
Rizwan Reza
b602ce6191
Refactored duplication into a separate method. Dropped class variable.
2010-06-11 16:34:53 +02:00
Rizwan Reza
6148b2dd73
Adding missing docs to delete cookies with :all which were added that way.
2010-06-11 16:34:53 +02:00
Rizwan Reza
f99132663b
Took out the domain option logic to cookies.rb.
2010-06-11 16:34:52 +02:00
Rizwan Reza
5609149d84
Moved Domain regexp to a constant and added comments.
2010-06-11 16:34:52 +02:00
Rizwan Reza
edbb78d6cc
The previous commit didn't work with complex domains, which is now fixed.
2010-06-11 16:34:52 +02:00
Rizwan Reza
44830ead1c
Add support for multi-subdomain session by setting cookie host in session cookie so you can share session between www.example.com, example.com and user.example.com. [ #4818 state:resolved]
...
This reverts commit 330a89072a .
2010-06-11 16:34:52 +02:00
José Valim
330a89072a
Revert "Add support for multi-subdomain session by setting cookie host in session cookie so you can share session between www.example.com, example.com and user.example.com. [ #4818 state:resolved]"
...
It does not work for domains like co.uk and com.br.
This reverts commit c4d6245e87 .
2010-06-10 20:08:01 +02:00
Guillermo Álvarez
c4d6245e87
Add support for multi-subdomain session by setting cookie host in session cookie so you can share session between www.example.com, example.com and user.example.com. [ #4818 state:resolved]
...
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com >
2010-06-10 12:05:12 -04:00
José Valim
211799450d
Ensure show exceptions middleware properly filters backtrace before logging.
2010-06-09 22:49:14 +02:00
José Valim
68b4720fd1
Accept both regexps and strings for LOCALHOST.
2010-06-08 20:11:05 +02:00
Prem Sichanugrist
c6ad64394b
Make sure that rails recognized the full notation of IPv6 loopback address, and recognize 127.0.0.0/8 in IPv4
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-06-08 19:45:40 +02:00
Jeremy Kemper
509f3d7d2f
Simplify middleware stack lazy compares using named const references
2010-06-05 22:09:16 -07:00
Jeremy Kemper
7ace23abac
Restore flash sweep
2010-06-05 22:05:57 -07:00
wycats
cb1b2a719a
Stop the flash middleware from forcibly loading sessions even if the user doesn't use sessions at all
2010-06-04 20:11:05 -07:00
Jeremy Kemper
bd9805871b
Include backtrace in failsafe log. Rescue possible exceptions in failsafe response.
2010-06-04 18:25:32 -07:00
José Valim
9a93844aba
Add :only and :except to controllers MiddlewareStack. This allows
...
you to do the following:
class PostsController < ApplicationController
use AutheMiddleware, :except => [:index, :show]
end
2010-05-30 15:53:14 +02:00
José Valim
19d8c8cbe4
Remove the laziness from the middleware stack.
2010-05-29 22:29:46 +02:00
wycats
45e60283e7
Removing Metal from Rails 3.
...
If you have existing Metals, you have a few options:
* if your metal behaves like a middleware, add it to the
middleware stack via config.middleware.use. You can use
methods on the middleware stack to control exactly where
it should go
* if it behaves like a Rack endpoint, you can link to it
in the router. This will result in more optimal routing
time, and allows you to remove code in your endpoint
that matches specific URLs in favor of the more powerful
handling in the router itself.
For the future, you can use ActionController::Metal to get
a very fast controller with the ability to opt-in to specific
controller features without paying the penalty of the full
controller stack.
Since Rails 3 is closer to Rack, the Metal abstraction is
no longer needed.
2010-05-29 20:08:00 +02:00
José Valim
d3e62fc57c
Avoid creating a Rack::Response object in the cookie middleware since it may stream the body.
2010-05-18 17:47:56 +02:00
José Valim
c536835957
Cut the fat and make session stores rely on request.cookie_jar and change set_session semantics to return the cookie value instead of a boolean.
2010-05-18 03:18:23 +02:00
José Valim
26e645fa00
Remove deprecated methods since 2-3-stable.
2010-05-18 02:11:50 +02:00
José Valim
25f7c030e4
Simplify cookie_store by simply relying on cookies.signed.
2010-05-18 02:05:20 +02:00
Martin
e807476d31
added convenience methods #notice and #alert to flash.now
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-05-15 16:52:19 +02:00
Josh Kalderimis
446b0ffe1c
corrected error message in session/cookie_store [ #4546 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-05-10 12:37:01 +03:00
José Valim
6c2d974e15
Use annoted source code in Template:Error to avoid special cases in the show exceptions middleware.
2010-05-09 12:52:30 +03:00
Lawrence Pit
1e1d30715e
Fix parsing xml input by ActionDispatch::ParamsParser
...
[#4437 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2010-05-06 20:34:47 -07:00
Carl Lerche
6c280f3398
RouteSet does not raise ActionController::RoutingError when no routes match anymore. Instead, it follows the X-Cascade convention. ShowExceptions checks for X-Cascade so that the routing error page can still be displayed.
2010-04-30 16:40:42 -07:00
Santiago Pastorino
961aa70e4a
Some require indifferent_access added
...
Signed-off-by: Xavier Noria <fxn@ubuntu.(none)>
2010-04-21 07:45:29 -07:00
Santiago Pastorino
5467728d83
require without .rb
...
Signed-off-by: Xavier Noria <fxn@ubuntu.(none)>
2010-04-21 07:41:45 -07:00
Santiago Pastorino
978c80d6e3
Missing require added
2010-04-18 14:02:46 -03:00
Jeremy Kemper
3957d44fd1
Use request.body IO and rewind, if possible
2010-04-07 11:42:07 -07:00
Joshua Peek
086392492c
Remove #size call on rack input io
2010-04-07 11:41:14 -07:00
José Valim
eb063538bd
Use config.filter_parameters on in-browser request dump. [ #4335 state:resolved]
2010-04-07 01:42:51 +02:00
José Valim
6690d66292
Rename config.cookie_secret to config.secret_token and pass it as configuration in request.env. This is another step forward removing global configuration.
2010-04-05 12:00:24 +02:00
Jeremy Kemper
e3959970e1
Fix signed cookies by explicitly passing config to the cookie jar
2010-04-04 11:10:00 -07:00
José Valim
62151dd272
Deprecate cookie_verifier_secret in favor of config.cookie_secret allowing signed cookies to work again.
2010-03-31 12:59:41 +02:00
wycats
77a2a3d9b3
Request#content_type exists in Rack::Request, and other parts of Rack::Request expect
...
it to return a String. Split the Rails API so that Request#content_type returns
a String, and Request#content_mime_type returns a Mime::Type object.
2010-03-28 13:40:38 -07:00
Xavier Noria
76f024ac8d
adds missing requires for Object#blank? and Object#present?
2010-03-28 14:15:02 +02:00
wycats
197904341f
Merge branch 'master' into docrails
2010-03-26 15:10:24 -07:00
Mathias Biilmann Christensen
c8dd6f224c
Deleting and setting a cookie in the same request was broken
...
Made sure to remove a cookie from @deleted_cookies when set
[#4211 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2010-03-17 18:04:32 -07:00
Pratik Naik
e68bfaf1fe
Merge remote branch 'mainstream/master'
...
Conflicts:
activerecord/lib/active_record/base.rb
railties/lib/rails/configuration.rb
railties/lib/rails/log_subscriber.rb
2010-03-12 16:00:01 +00:00
Carlhuda
056042eb82
Simplify the action endpoint:
...
* Remove ActionEndpoint in favor of passing a block to MiddlewareStack
* Always create a Request; the performance win of RackDelegation is around
the response; the Request object hit is limited to a single object allocation
* #dispatch takes a Request
2010-03-08 16:50:00 -08:00
wycats
39d6f9e112
Make many parts of Rails lazy. In order to facilitate this,
...
add lazy_load_hooks.rb, which allows us to declare code that
should be run at some later time. For instance, this allows
us to defer requiring ActiveRecord::Base at boot time purely
to apply configuration. Instead, we register a hook that should
apply configuration once ActiveRecord::Base is loaded.
With these changes, brings down total boot time of a
new app to 300ms in production and 400ms in dev.
TODO: rename base_hook
2010-03-07 06:24:30 -08:00
Carlhuda
e311622e7b
Deprecated ActionController::Base.session_options= and ActionController::Base.session_store= in favor of a config.session_store method (which takes params) and a config.cookie_secret variable, which is used in various secret scenarios. The old AC::Base options will continue to work with deprecation warnings.
2010-03-04 16:05:52 -08:00
Carlhuda
93422af5d5
Move remote_ip to a middleware:
...
* ActionController::Base.ip_spoofing_check deprecated => config.action_dispatch.ip_spoofing_check
* ActionController::Base.trusted_proxies deprecated => config.action_dispatch.trusted_proxies
2010-03-03 21:24:00 -08:00
Carl Lerche
9a9caf646d
Add a BlockUntrustedIps middleware
2010-03-03 21:24:00 -08:00
José Valim
e49f94d71c
Revert behavior from a5684dfa3c and ensure after_initializer is executed after to_prepare callbacks.
2010-02-19 08:15:49 +01:00
José Valim
ea8f9880c4
Remove outdated docs.
2010-02-09 08:38:33 -07:00
José Valim
02908e1142
As first step setup the load path and lazy compare middlewares.
2010-01-25 22:59:08 +01:00