Commit Graph

4700 Commits

Author SHA1 Message Date
Jeremy Kemper
c8f7860d50 CGI escape the session cookie.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6200 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-22 01:17:28 +00:00
Jeremy Kemper
223509ba7d Oops, don't omit the session_key since it's used as the cookie name.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6199 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-22 01:07:51 +00:00
Jeremy Kemper
5a1251dc2d Session configuration in config/environment.rb instead of app/controllers/application.rb
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6198 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-22 00:57:02 +00:00
Jeremy Kemper
45dd256889 Missed commit for [6184]. Generate a random secret for new app's cookie session store.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6197 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-21 23:13:32 +00:00
David Heinemeier Hansson
25bb98e42d Added database connection as a yield parameter to ActiveRecord::Base.transaction so you can manually rollback [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6196 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-21 22:13:39 +00:00
Tobias Lütke
7842caed94 Fixed query cache when multiple database connections were involved
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6195 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-21 21:54:41 +00:00
Tobias Lütke
2ffbc6115e Enable active record cache automatically for all actions
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6189 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-21 18:08:39 +00:00
David Heinemeier Hansson
9b854c22b1 Added subdirectory test
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6188 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-21 15:58:42 +00:00
David Heinemeier Hansson
7f55931f80 Make sure that the filesystem is not involved with asset hosting
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6187 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-21 15:28:37 +00:00
Jeremy Kemper
de0a0d700e Routing: better support for escaped values in route segments. Closes #7544.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6185 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-21 10:05:07 +00:00
Jeremy Kemper
f29857690f Introduce a cookie-based session store as the Rails default. Sessions typically contain at most a user_id and flash message; both fit within the 4K cookie size limit. A secure hash is included with the cookie to ensure data integrity (a user cannot alter his user_id without knowing the secret key included in the hash). If you have more than 4K of session data or don't want your data to be visible to the user, pick another session store. Cookie-based sessions are dramatically faster than the alternatives.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6184 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-21 09:17:38 +00:00
David Heinemeier Hansson
2afc01b7ce Make assert_select access content_type through accessor instead of header
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6181 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-21 00:40:58 +00:00
David Heinemeier Hansson
21187c0fb4 Apply the rest of Chads patch
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6180 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-21 00:29:44 +00:00
Tobias Lütke
b5419cd66e You can now use cache in instance hierachies. This allows ActiveRecord::Base.cache { } usage to cache everything
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6179 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-20 23:42:04 +00:00
David Heinemeier Hansson
e105653066 Added .erb and .builder as preferred aliases to the now deprecated .rhtml and .rxml extensions [Chad Fowler]. This is done to separate the renderer from the mime type. .erb templates are often used to render emails, atom, csv, whatever. So labeling them .rhtml doesn't make too much sense. The same goes for .rxml, which can be used to build everything from HTML to Atom to whatever. .rhtml and .rxml will continue to work until Rails 3.0, though. So this is a slow phasing out. All generators and examples will start using the new aliases, though.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6178 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-20 22:09:12 +00:00
Michael Koziarski
89cb34c9cf Stop swallowing errors during rake test [Koz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6176 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-20 03:15:26 +00:00
Jeremy Kemper
772e02dd62 Factor out unique id generator. Expose cgi to session store.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6174 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-19 23:51:25 +00:00
David Heinemeier Hansson
9e4c8b8858 Fix tests depending too deep
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6169 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-19 02:25:01 +00:00
David Heinemeier Hansson
94fa0ed053 Its ETag not Etag
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6168 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-19 02:10:19 +00:00
David Heinemeier Hansson
bd0cd04374 Set cache-control to private if theres an etag available (and the cache-control hasnt been overwritten already)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6167 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-19 02:04:26 +00:00
David Heinemeier Hansson
372db1cd9e Dont ask for no caching if we have a etag to base that decision on
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6166 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-19 01:33:35 +00:00
David Heinemeier Hansson
7ec0204ecd Move etagging down to response, so renders with layouts dont screw it up [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6165 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-19 00:27:19 +00:00
David Heinemeier Hansson
aad7fbde68 Added caching option to AssetTagHelper#stylesheet_link_tag and AssetTagHelper#javascript_include_tag [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6164 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-18 23:54:20 +00:00
David Heinemeier Hansson
109d4ac954 Allow people to set their own etags, if they want more control over the process (closes #7580) []
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6163 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-18 16:32:05 +00:00
Jeremy Kemper
c9260c556c Add request protocol to asset host if not given. Prefer setting asset host as hostname only, no request protocol.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6162 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-18 07:23:57 +00:00
Jeremy Kemper
90c1207c38 Work around the two connection per host browser limit: use asset%d.myapp.com to distribute asset requests among asset[0123].myapp.com. Use a DNS wildcard or CNAMEs to map these hosts to your asset server. See http://www.die.net/musings/page_load_time/ for background.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6161 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-18 06:44:20 +00:00
Jeremy Kemper
4fd84aae90 Etagging ignores appended and block responses.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6160 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-18 00:47:18 +00:00
David Heinemeier Hansson
392c7f7314 Added default mime type for CSS (Mime::CSS) [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6159 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-18 00:00:14 +00:00
David Heinemeier Hansson
2e55095f6f Added that rendering will automatically insert the etag header on 200 OK responses. The etag is calculated using MD5 of the response body. If a request comes in that has a matching etag, the response will be changed to a 304 Not Modified and the response body will be set to an empty string. [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6158 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-17 18:16:44 +00:00
David Heinemeier Hansson
cfa7df3fbb Added X-Runtime to all responses with the request run time [DHH] (rename from X-Benchmark)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6157 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-17 05:11:55 +00:00
David Heinemeier Hansson
c74c78c88d Added X-Benchmark to all responses with the same benchmark data as goes into the log [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6156 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-16 21:13:02 +00:00
David Heinemeier Hansson
06669f8b13 In tests, content_type can be nil, which would disturb accepts/format
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6155 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-15 18:52:08 +00:00
Rick Olson
e312cc3215 remove Mime::PLAIN from tests so its not confused with the default Mime::TEXT mime type
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6153 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-15 16:40:38 +00:00
Rick Olson
5d54b8f07c Add Mime::Type convenience methods to check the current mime type. [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6152 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-15 16:25:46 +00:00
Jeremy Kemper
5b7630e174 MySQL disallows TEXT defaults so don't test for them.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6149 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-11 09:17:10 +00:00
Jeremy Kemper
002c0aeef3 Hash#to_query CGI-escapes its keys.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6148 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-11 06:29:04 +00:00
Jeremy Kemper
39ae7025e8 Don't test for hash sort order.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6147 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-11 04:40:58 +00:00
Jeremy Kemper
eb2dad2fe5 Revert [6086] and [6087] since they caused a major regression with functional tests in 1.2.2. References #7372.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6145 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-10 03:55:12 +00:00
Jeremy Kemper
916f9e5143 Performance: patch cgi/session to require digest/md5 once rather than per #create_new_id.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6143 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-10 02:44:32 +00:00
Thomas Fuchs
c9108f3e39 Add a :url_based_filename => true option to ActionController::Streaming::send_file, which allows URL-based filenames. [Thomas Fuchs]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6142 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-09 11:25:37 +00:00
Jeremy Kemper
9daddf0116 Deprecation: warn on stderr if RAILS_DEFAULT_LOGGER isn't set yet.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6140 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-08 00:17:39 +00:00
Jamis Buck
83752373b9 Made increment_counter/decrement_counter play nicely with optimistic locking, and added a more general update_counters method
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6139 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-07 16:10:40 +00:00
Tobias Lütke
f458b376c5 Introducing Model.cache { ... } for the occasional query caching needs. ( fantastic to reduce the 200 SELECT * from accounts WHERE id=1 queries in your views )
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6138 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-06 21:16:07 +00:00
David Heinemeier Hansson
23b2abe313 More Safari appeasement
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6137 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-06 20:29:15 +00:00
David Heinemeier Hansson
f57367c832 Safari requires an explicit submit
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6136 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-06 19:30:52 +00:00
David Heinemeier Hansson
06b1198736 Fix that FormTagHelper#submit_tag using :disable_with should trigger the onsubmit handler of its form if available [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6134 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-06 17:48:38 +00:00
Rick Olson
9f31ecb4c9 rename #lookup_template_base_path_for to #find_base_path_for in ActionView::Base [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6132 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-06 03:58:48 +00:00
Rick Olson
2782c37bdf Fix #render_file so that TemplateError is called with the correct params and you don't get the WSOD. [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6130 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-05 05:39:23 +00:00
Rick Olson
38e5d21bc4 Fix Rails::Initializer since #view_paths is never nil
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6127 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-04 22:56:36 +00:00
Rick Olson
f2f2686f97 Update Rails Initializer to use ActionController::Base#view_paths [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6126 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-04 22:41:37 +00:00