Commit Graph

235 Commits

Author SHA1 Message Date
Will Bryant
d625a7ac17 fix the Flash middleware loading the session on every request (very dangerous especially with Rack::Cache), it should only be loaded when the flash method is called 2012-04-30 00:20:17 -07:00
Carlos Antonio da Silva
a16aa8c3d2 Return the same session data object when setting session id
Make sure to return the same hash object instead of returning a new one.
Returning a new one causes failures on cookie store tests, where it
tests for the 'Set-Cookie' header with the session signature.

This is due to the hash ordering changes on Ruby 1.8.7-p358.
2012-03-26 16:18:20 -03:00
Andrew White
bea34a7729 Simplify regexp 2012-02-17 14:45:09 +00:00
Andrew White
5fcbb94edc Fix ActionDispatch::Static to serve files with unencoded PCHAR
RFC 3986[1] allows sub-delim characters in path segments unencoded,
however Rack::File requires them to be encoded so we use URI's
unescape method to leave them alone and then escape them again.

Also since the path gets passed to Dir[] we need to escape any glob
characters in the path.

[1]: http://www.ietf.org/rfc/rfc3986.txt
2012-02-17 14:16:45 +00:00
José Valim
4cdc31c53a Add some implementation docs. closes #3298. closes #2509. 2011-10-12 09:24:13 +02:00
Bruno Zanchet
4d986c4a10 swallow error when can't unmarshall object from session
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-10-12 09:21:42 +02:00
Aaron Patterson
af7c9b9cef CookieJar is enumerable. fixes #2795 2011-09-01 13:37:33 -07:00
José Valim
cb307d1c4a Add has_key? and key? methods to CookieJar removed in 0ca69ca65f 2011-06-30 08:02:37 -03:00
Jon Leighton
5a6927ec1e Replace references to ActiveSupport::SecureRandom with just SecureRandom, and require 'securerandom' from the stdlib when active support is required. 2011-05-23 20:24:44 +01:00
steve
7c000af867 fixing sym and string cookie name, two cookies to browser bug. 2011-05-19 09:49:16 -04:00
José Valim
0e5adbceb7 Don't pluralize, camelize. 2011-05-06 17:00:59 +02:00
David Heinemeier Hansson
5b8801442e Only show dump of regular env methods on exception screen (not all the rack crap) [DHH] 2011-05-04 19:56:56 -05:00
José Valim
afc3ccf74c Fix renew feature on cookies. 2011-05-04 20:12:27 +02:00
Aaron Patterson
af8c54be0a cache strings in the AST for faster comparison than include? 2011-05-03 09:59:21 -07:00
Matias Korhonen
49b825e502 Sets the HTTP charset parameter for rescue response. 2011-05-03 16:30:59 +03:00
Matias Korhonen
c7f7a45676 Rescues template HTML5 doctype and the utf8 charset meta tag, and better font choices for Mac users. 2011-05-03 16:30:04 +03:00
José Valim
e1c1685016 Static middleware accepts cache control. 2011-05-03 12:32:14 +02:00
Schneems
a8870d140e show http method in routing error message 2011-04-23 03:40:09 +08:00
José Valim
2f549b8bbd Use initialize_copy! to proper initialize now on clone. 2011-04-19 22:38:51 +02:00
Florent Piteau
89ed9fbd19 Don't reuse a closed flash when using now 2011-04-20 04:32:26 +08:00
José Valim
a66c917235 Do not inherit from Rack::Response, remove a shit-ton of unused code. 2011-04-19 11:54:12 +02:00
José Valim
6380f1a9f4 Be sure to not store the closed flash in the session. 2011-04-19 10:34:17 +02:00
José Valim
d5ad92ced1 Make static faster as we don't have to serve multiple paths anymore. 2011-04-15 20:09:39 +02:00
Aaron Patterson
199c0bb338 generated session ids should be encoded as UTF-8 2011-04-14 13:37:40 -07:00
Aaron Patterson
a7c5d40d80 Merge branch 'master' of github.com:rails/rails
* 'master' of github.com:rails/rails:
  Cache flash now
  Revert "Use freeze instead of close!"
  Revert "Eagerly load Signed and Permanent cookies"
  cookies here
  Eagerly load Signed and Permanent cookies
  Use freeze instead of close!
2011-04-07 09:35:24 -07:00
Santiago Pastorino
0e624ce9eb Cache flash now 2011-04-07 09:27:00 -03:00
Santiago Pastorino
03d561ad77 Revert "Use freeze instead of close!"
This reverts commit 29592a7f09.
2011-04-07 09:26:04 -03:00
Santiago Pastorino
5b0149a17a Revert "Eagerly load Signed and Permanent cookies"
This reverts commit dffeda3770.
2011-04-07 09:20:56 -03:00
Santiago Pastorino
dffeda3770 Eagerly load Signed and Permanent cookies 2011-04-07 09:15:28 -03:00
Aaron Patterson
32f876786a getting the flash hash under test 2011-04-06 18:01:03 -07:00
Aaron Patterson
76c2ea7882 favor composition over inheritance, have FlashHash delegate to a Hash 2011-04-06 17:26:55 -07:00
Santiago Pastorino
29592a7f09 Use freeze instead of close! 2011-04-06 20:53:48 -03:00
Aaron Patterson
0ca69ca65f CookieJar should prefer composition over inheritance 2011-04-06 16:27:05 -07:00
Santiago Pastorino
0c5aded092 raise if someone tries to modify the cookies when it was already streamed back to the client or converted to HTTP headers 2011-04-06 15:47:58 -03:00
Santiago Pastorino
90ecad0bc9 Add ClosedError message to the initializer 2011-04-06 15:45:23 -03:00
Santiago Pastorino
d7a5638dfb raise if someone tries to modify the flash when it was already streamed back to the client or converted to HTTP headers 2011-04-05 10:41:34 -03:00
Josh Kalderimis
5170d210e8 correction to the outputted controller name in the diagnostics error template, test included
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-03-24 19:43:48 -03:00
Jon Leighton
735844db71 Merge branch 'master' into nested_has_many_through
Conflicts:
	activerecord/CHANGELOG
	activerecord/lib/active_record/association_preload.rb
	activerecord/lib/active_record/associations.rb
	activerecord/lib/active_record/associations/class_methods/join_dependency.rb
	activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb
	activerecord/lib/active_record/associations/has_many_association.rb
	activerecord/lib/active_record/associations/has_many_through_association.rb
	activerecord/lib/active_record/associations/has_one_association.rb
	activerecord/lib/active_record/associations/has_one_through_association.rb
	activerecord/lib/active_record/associations/through_association_scope.rb
	activerecord/lib/active_record/reflection.rb
	activerecord/test/cases/associations/has_many_through_associations_test.rb
	activerecord/test/cases/associations/has_one_through_associations_test.rb
	activerecord/test/cases/reflection_test.rb
	activerecord/test/cases/relations_test.rb
	activerecord/test/fixtures/memberships.yml
	activerecord/test/models/categorization.rb
	activerecord/test/models/category.rb
	activerecord/test/models/member.rb
	activerecord/test/models/reference.rb
	activerecord/test/models/tagging.rb
2011-03-04 09:30:27 +00:00
John Firebaugh
57bc25c5f8 Use run_callbacks; the generated _run_<name>_callbacks method is not a public interface.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-01-31 19:45:53 -02:00
brainopia
8491f16e12 Add tld_length option when using domain :all in cookies
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-01-21 13:13:51 +01:00
brainopia
91a4193ee0 Support list of possible domains for cookies
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-01-21 13:13:43 +01:00
Aaron Patterson
16ae08fff0 use raise to create exceptions and to set the backtrace 2011-01-12 11:15:11 -08:00
Aaron Patterson
1d9c555297 reraising should be in the rescue block 2011-01-12 11:15:10 -08:00
Krekoten' Marjan
366e7854ac Refactor to handle the X-Cascade without having to raise an exception 2011-01-09 16:08:54 -08:00
Santiago Pastorino
171172f324 render :template is faster than render :file 2011-01-01 13:44:34 -02:00
Santiago Pastorino
9bc879d42a This is not needed anymore 2011-01-01 13:20:00 -02:00
José Valim
d6efd3cfc2 Don't deprecate to_prepare. 2010-12-23 19:21:14 +01:00
José Valim
819b8cae40 Clean up callbacks should also be called on exceptions. 2010-12-23 19:17:02 +01:00
John Firebaugh
0b0e6f13c0 Typo (request -> response) 2010-12-21 19:32:34 -08:00
John Firebaugh
d4afde9ab0 Expand ActionDispatch::Reloader docs 2010-12-21 19:26:33 -08:00