Jeremy Kemper
d9f3c435f9
Fix url_for, redirect_to, etc. with :controller => :symbol instead of 'string'. Closes #8562 , #9525 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7776 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-07 19:12:02 +00:00
Jeremy Kemper
52ca5dad1e
Use StringIO and Tempfile subclasses instead of defining singleton methods on each multipart field.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7759 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-06 11:40:13 +00:00
Jeremy Kemper
3405fb3dea
Rewind stdin if possible after multipart parsing.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7758 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-06 09:39:31 +00:00
Jeremy Kemper
551f6e9bee
Don't generate strings to log unless they'll actually get logged.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7757 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-06 09:28:50 +00:00
Jeremy Kemper
12d740dd57
Move #query_string to AbstractRequest
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7727 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-03 16:39:18 +00:00
Rick Olson
3dc62ab8f9
rescue LoadError if memcache isn't available while loading the MemCache fragment store
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7726 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-03 16:15:42 +00:00
Rick Olson
408f496402
Use #require_library_or_gem to load the memcache library for the MemCache session and fragment cache stores. Closes #8662 . [Rick]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7725 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-03 14:52:56 +00:00
Rick Olson
904df818d6
Move ActionController::Routing.optimise_named_routes to ActionController::Base.optimise_named_routes. Now you can set it in the config.
...
ActionController::Routing::DynamicSegment#interpolation_chunk should call #to_s on all values before calling URI.escape. [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7724 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-03 05:47:41 +00:00
Michael Koziarski
eb5033ad6b
Merge session fixation fixes from stable
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7722 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-02 05:58:16 +00:00
Jeremy Kemper
0ee1cb2cd3
Ruby 1.9 compat, consistent load paths
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7719 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-02 05:32:14 +00:00
David Heinemeier Hansson
860cf2d44e
Fixed that render template did not honor exempt_from_layout ( closes #9698 ) [pezra]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7701 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-30 22:59:24 +00:00
David Heinemeier Hansson
8e067b0b44
Fixed that a response has to be available for that exact mime type for it to be called (otherwise 406 should occur)
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7681 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-29 21:56:21 +00:00
Michael Koziarski
4953563e08
Ensure request is present, as well as defined. [nzkoz]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7676 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-29 02:19:16 +00:00
Michael Koziarski
9660360d6b
Re-enable Routing optimisation code for _url methods, add defined?(request) to the guard conditions
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7673 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-28 20:57:39 +00:00
Rick Olson
82ff27766d
Better error messages if you leave out the :secret option for request forgery protection. Closes #9670 [rick]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7671 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-28 16:50:48 +00:00
Rick Olson
5edc81dcc2
Allow ability to disable request forgery protection, disable it in test mode by default. Closes #9693 [lifofifo]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7668 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-28 15:55:45 +00:00
David Heinemeier Hansson
e3b49c052b
Fixed spelling errors ( closes #9706 ) [tarmo/rmm5t]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7666 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-28 14:18:47 +00:00
David Heinemeier Hansson
3c695356ae
Fixed the layout defaults ( closes #9564 ) [lifo]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7661 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-28 01:23:20 +00:00
Nicholas Seckar
5430eb6dcd
Avoid calling is_missing on LoadErrors. Closes #7460 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7644 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-27 05:04:02 +00:00
Jeremy Kemper
1c68394b68
Reinstate the default AR.instantiate_observers to_prepare block.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7641 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-26 01:29:28 +00:00
Jeremy Kemper
f08da31a4f
Move Railties' Dispatcher to ActionController::Dispatcher, introduce before_ and after_dispatch callbacks, and warm up to non-CGI requests.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7640 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-26 01:24:07 +00:00
David Heinemeier Hansson
55a9c86e62
Added failing tests for iphone
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7629 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-25 14:57:15 +00:00
David Heinemeier Hansson
bdf5672077
Change from InvalidToken to InvalidAuthenticityToken to be more specific
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7623 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-24 23:12:25 +00:00
Jeremy Kemper
dfcb5af2dc
Move rescue_action_with_handler from rescue_action to perform_action so it isn't clobbered by test overrides. References #9449 , closes #9645 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7618 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-24 19:56:11 +00:00
Rick Olson
2c73115b2f
port over some of the csrf_killer README docs
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7614 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-24 17:59:17 +00:00
David Heinemeier Hansson
911ea2f26f
Beefed up docs a bit
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7612 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-24 17:02:02 +00:00
Jeremy Kemper
cb5b8a7f05
Optimized named routes respect AbstractRequest.relative_url_root. Closes #9612 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7605 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-23 22:52:57 +00:00
David Heinemeier Hansson
2cfe118305
Dont need all of test/unit ( closes #6673 ) [zenspider/josh]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7602 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-23 22:12:45 +00:00
Jeremy Kemper
6580b3ab00
Remove , and ; (comma and semicolon) from routing separators again. References #8558 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7599 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-23 21:58:02 +00:00
David Heinemeier Hansson
7d9fe04b1d
Fixed cache_page to use the request url instead of the routing options when picking a save path ( closes #8614 ) [josh]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7598 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-23 21:56:52 +00:00
Jeremy Kemper
a6f49d9b78
Introduce ActionController::Base.rescue_from to declare exception-handling methods. Cleaner style than the case-heavy rescue_action_in_public. Closes #9449 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7597 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-23 21:56:22 +00:00
Rick Olson
c619003854
Rename some RequestForgeryProtection methods. The class method is now #protect_from_forgery, and the default parameter is now 'authenticity_token'. [Rick]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7596 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-23 18:14:44 +00:00
Rick Olson
4e3ed5bc44
Merge csrf_killer plugin into rails. Adds RequestForgeryProtection model that verifies session-specific _tokens for non-GET requests. [Rick]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7592 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-23 02:32:55 +00:00
David Heinemeier Hansson
ee45d76df8
Roll back #7578 , tests failed
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7580 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-22 23:10:41 +00:00
David Heinemeier Hansson
9ab8d4d9ed
Improve the error message for assert_redirected_to ( closes #7337 ) [sandofsky]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7578 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-22 22:22:20 +00:00
Michael Koziarski
7573791284
Disable the routing optimisation code when dealing with foo_url helpers. Add test to actionmailer to expose the problem they introduced. References #9450 [Koz]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7572 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-22 19:20:06 +00:00
Nicholas Seckar
defb4d08dc
Remove use of & logic operator. Closes #8114 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7571 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-22 19:02:51 +00:00
David Heinemeier Hansson
712b71371d
Doc fix ( closes #9123 ) [tzaharia]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7559 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-22 18:03:31 +00:00
David Heinemeier Hansson
d1808916ae
Fix buffer
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7534 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-22 05:14:56 +00:00
Michael Koziarski
9b468f4cd7
[html-scanner] Fix parsing of empty tags. Closes #7641 . [anthony.bailey]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7528 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-21 20:45:49 +00:00
Michael Koziarski
045aee8912
Prevent clashing named routes when using uncountable resources. Closes #9598
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7526 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-21 18:06:01 +00:00
David Heinemeier Hansson
eede82ccb9
Added support for HTTP Only cookies (works in IE6+ and FF 2.0.5+) as an improvement for XSS attacks ( closes #8895 ) [lifo/Spakman]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7525 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-21 15:05:49 +00:00
Nicholas Seckar
16529a92dd
Don't warn when a path segment precedes a required segment. Closes #9615 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7523 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-21 04:52:18 +00:00
David Heinemeier Hansson
1373991dd8
Added that render :json will automatically call .to_json unless its being passed a string [DHH] Added Mime::Type.register_alias for dealing with different formats using the same mime type [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7520 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-20 23:34:07 +00:00
David Heinemeier Hansson
0d99423727
Fixed that default layouts did not take the format into account #9564 [lifofifo]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7514 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-18 23:10:34 +00:00
David Heinemeier Hansson
4e7dce7e40
Added security notice to Request#remote_ip underlining the fact that its value can be spoofed (and that you should use Request#remote_addr if thats a concern for your application) [Adrian Holovaty]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7502 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-17 11:12:10 +00:00
Michael Koziarski
7cb26b5d2d
Disable optimisation code for UrlWriter as request.host doesn't make sense there.
...
Don't try to use the .to_query method when the route has no dynamic segments.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7501 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-17 09:30:18 +00:00
Jeremy Kemper
bfb906a905
Speed up and simplify query caching.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7498 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-17 06:15:58 +00:00
Jeremy Kemper
148202d401
Fixed optimized route segment escaping. Closes #9562 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7487 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-15 22:10:20 +00:00
Jeremy Kemper
494d2c631b
root_path returns '/' not ''. Closes #9563 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7482 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-15 20:38:39 +00:00