Jeremy Kemper
b7529ed1cc
Simplifying usage of ETags and Last-Modified and conditional GET requests
2008-08-07 23:43:12 -07:00
Pratik Naik
98dc582742
Merge docrails.
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-05-25 12:29:00 +01:00
Jeremy Kemper
b43309328a
Ruby 1.9 compat: ensure binary encoding for post body parsing
2008-05-19 16:24:26 -07:00
Jeremy Kemper
a1b0349362
The asset_host block takes the controller request as an optional second argument. Example: use a single asset host for SSL requests. Closes #10549 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8578 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-06 20:53:23 +00:00
Michael Koziarski
41fb4904e2
Refactor cookie_only option to survive multiple requests and add regression tests. References #10048 . [theflow]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8176 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-21 04:28:59 +00:00
David Heinemeier Hansson
9a8d583a91
Fixed that ActionController::CgiRequest#host_with_port() should handle standard port ( closes #10082 ) [moro]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8088 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-06 16:36:10 +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
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
Jeremy Kemper
33e5e41dda
request.host works with IPv6 addresses. Closes #9458 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7382 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-31 19:03:42 +00:00
Jeremy Kemper
9159489872
Don't mistakenly interpret the request uri as the query string. Closes #8731 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7084 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-23 00:13:40 +00:00
Jeremy Kemper
4bd3e3aa1b
Set RAW_POST_DATA when request parameters are parsed.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6823 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-23 19:09:37 +00:00
Jeremy Kemper
d2ed32d592
Parse url-encoded and multipart requests ourselves instead of delegating to CGI.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6764 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-18 06:24:50 +00:00
Jeremy Kemper
9d1f1a8655
Simplify CgiRequest#query_parameters
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6743 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-15 23:56:09 +00:00
Jeremy Kemper
f73e1c2ec0
Move request parameter parsing from CGI to AbstractRequest.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6742 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-15 22:10:03 +00:00
Jeremy Kemper
32d03af341
Introduce the request.body stream. Lazy-read to parse parameters rather than always setting RAW_POST_DATA. Reduces the memory footprint of large binary PUT requests.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6740 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-15 21:36:21 +00:00
Jeremy Kemper
f8273e4309
Shine some sunlight on the CGI extensions. Remove unused CGI#session.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6733 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-15 00:08:05 +00:00
Jeremy Kemper
814dd007e5
Performance: patch cgi/session/pstore to require digest/md5 once rather than per #initialize. Closes #7583 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6431 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-16 05:52:12 +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
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
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
Nicholas Seckar
b7df916249
Change session restoration to allow namespaced models to be autoloaded. Closes #6348 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6054 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-28 06:19:07 +00:00
Jeremy Kemper
e03cd53a7a
use stringify_keys
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5824 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-01 01:32:24 +00:00
Jeremy Kemper
fe7995f718
Merge [5822] from 1.2 (oops, wrong order).
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5823 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-01 01:30:28 +00:00
Jeremy Kemper
0f048a5c98
Set session to an empty hash if :new_session => false and no session cookie or param is present. CGI::Session was raising an unrescued ArgumentError.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5820 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-01 01:13:09 +00:00
David Heinemeier Hansson
7c7d58937b
Fixed that HEAD should return the proper Content-Length header (that is, actually use @body.size, not just 0) [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5622 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-23 23:52:25 +00:00
Jeremy Kemper
5c2e9a5e48
Cache parsed query parameters. Closes #6559 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5442 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-06 21:43:21 +00:00
Nicholas Seckar
5e5b87b412
Update CGI process to allow sessions to contain namespaced models. Closes #4638 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5152 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-09-20 17:46:59 +00:00
Jeremy Kemper
0da2357527
Rescue Errno::ECONNRESET to handle an unexpectedly closed socket connection. Improves SCGI reliability. Closes #3368 , closes #6226 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5146 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-09-18 23:52:03 +00:00
Nicholas Seckar
d34a346d9d
Switch to using FormEncodedPairParser for parsing request parameters.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4866 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-30 05:50:02 +00:00
David Heinemeier Hansson
d164d09649
FormEncodedStringParser needs a tad more work before it can handle POST data (like file handling), so were backing out for a bit
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4833 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-28 14:05:05 +00:00
David Heinemeier Hansson
04fda65306
Changed the POST parameter processing to use the new QueryStringParser and make the result a indifferent hash [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4821 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-26 02:49:09 +00:00
Jeremy Kemper
71234daef1
r4487@asus: jeremy | 2006-04-29 12:21:39 -0700
...
Check whether @flash is defined? for warnings-safety.
r4488@asus: jeremy | 2006-04-29 12:23:15 -0700
Check whether @flash is defined? for warnings-safety. Obviates nil? check.
r4489@asus: jeremy | 2006-04-29 12:45:18 -0700
Check whether @session is defined? for warnings-safety.
r4490@asus: jeremy | 2006-04-29 12:50:41 -0700
Check whether @rendering_runtime is defined? for warnings-safety.
r4491@asus: jeremy | 2006-04-29 12:55:01 -0700
Check whether @_cycles is defined? for warnings-safety.
r4492@asus: jeremy | 2006-04-29 12:59:19 -0700
Check whether instance variables are defined? for warnings-safety.
r4493@asus: jeremy | 2006-04-29 13:14:09 -0700
Add nil @template to PrototypeHelperTest to suppress unitialized instance variable warning.
r4494@asus: jeremy | 2006-04-29 13:31:34 -0700
Check whether @auto_index defined? for warnings-safety.
r4495@asus: jeremy | 2006-04-29 13:32:24 -0700
Wrap content_columns redefinitions with silence_warnings.
r4496@asus: jeremy | 2006-04-29 13:35:28 -0700
Wrap more redefinitions with silence_warnings.
r4829@asus: jeremy | 2006-07-08 10:59:20 -0700
abstract unit, fix warnings
r4830@asus: jeremy | 2006-07-08 11:06:12 -0700
Use parens to silence warning.
r4831@asus: jeremy | 2006-07-08 11:06:48 -0700
Use parens to silence warning.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4595 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-07-08 18:14:49 +00:00
Marcel Molina
c745f47804
Use #flush between switching from #write to #syswrite. Closes #4907 . [Blair Zajac <blair@orcaware.com>]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4306 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-04-29 05:06:49 +00:00
Rick Olson
e1c7b5a7f6
Cache CgiRequest#request_parameters so that multiple calls don't re-parse multipart data.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4256 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-04-23 18:18:17 +00:00
David Heinemeier Hansson
d19e8f412f
Performance speedup for ActionController ( closes #4174 ) [Stefan Kaes] Includes caching of filter chains -- be on the lookout for problems with that!
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3989 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-20 04:01:10 +00:00
David Heinemeier Hansson
4e15bf787e
Fixed proxy support for lighttpd ( closes #3267 ) [stephen_purcell@yahoo.com]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3894 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-16 04:16:08 +00:00
Tobias Lütke
03d37a2d68
Added new infrastructure support for REST webservices.
...
By default application/xml posts are handled by creating a XmlNode object with the same name as the root element of the submitted xml. M$
ActionController::Base.param_parsers['application/atom+xml'] = Proc.new do |data|
node = REXML::Document.new(post)
{ node.root.name => node.root }
end
XmlSimple and Yaml web services were retired, ActionController::Base.param_parsers carries an example which shows how to get this functio$
request.[formatted_post?, xml_post?, yaml_post? and post_format] were all deprecated in favor of request.content_type [Tobias Luetke]
Closes #4081
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3777 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-05 18:59:58 +00:00
David Heinemeier Hansson
30caefdfc7
Backed out of that. PStore doesnt support suffix :(
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3768 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-04 22:49:52 +00:00
David Heinemeier Hansson
a1d70a5329
Backed out of that. PStore doesnt support suffix :(
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3767 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-04 22:41:59 +00:00
David Heinemeier Hansson
56b75a7e04
CHANGED DEFAILT: File-based sessions now have a suffix of ".rails_session" instead of a prefix called "ruby_sess." [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3766 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-04 22:31:50 +00:00
Jeremy Kemper
7654082260
Major components cleanup and speedup. Closes #3527 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3563 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-02-09 20:05:11 +00:00
Michael Koziarski
302533b196
Add support for multiple proxy servers in HTTP_X_FORWARDED_HOST. Closes #3397
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3412 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-01-13 08:31:16 +00:00
David Heinemeier Hansson
d345b7a4f0
Back out of 3109 for now as it seems to interfere with the flash
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3150 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-11-21 16:59:25 +00:00
Jeremy Kemper
da9f713d2c
r3209@asus: jeremy | 2005-11-20 01:04:22 -0800
...
If sessions are disabled, return a hash that raises an error when it's accessed.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3109 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-11-20 09:06:43 +00:00
Jeremy Kemper
ba942dfc45
fewer objects, no loop in convert_content_type. Closes #2883 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3058 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-11-16 09:05:04 +00:00
Jeremy Kemper
3661eacfbd
Include all of session creation in stale_session_check
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2958 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-11-09 20:34:44 +00:00
Jeremy Kemper
bb4c32e2b5
Delete existing sessions with the same session id before creating a new session. Prevents duplication and hijacking.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2946 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-11-09 06:00:46 +00:00
Nicholas Seckar
e0e8f0a302
Fix Request#host_with_port to use the standard port when Rails is behind a proxy.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2596 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-10-15 01:00:25 +00:00
David Heinemeier Hansson
3754822f43
Fixed problem with send_file and WEBrick using stdout #1812
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2274 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-20 10:53:33 +00:00