aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/request_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Move controller assertions from base TestCase to AC:: and AV::TestCaseJeremy Kemper2008-11-071-13/+13
|
* Request#remote_ip handles the uncommon case that REMOTE_ADDR is a ↵Michael S. Klishin2008-08-271-0/+3
| | | | | | | | comma-separated list. [#523 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Use RackRequest as a mock instead of StubCGI into RequestTestJoshua Peek2008-08-171-14/+10
|
* Update tests for request memoizationJeremy Kemper2008-08-081-44/+51
|
* AbstractRequest.relative_url_root is no longer automatically configured by a ↵Joshua Peek2008-07-241-73/+27
| | | | HTTP header. It can now be set in your configuration environment with config.action_controller.relative_url_root
* Disable the Accept header by defaultMichael Koziarski2008-07-071-1/+1
| | | | | | | | The accept header is poorly implemented by browsers and causes strange errors when used on public sites where crawlers make requests too. You should use formatted urls (e.g. /people/1.xml) to support API clients. Alternatively to re-enable it you need to set: config.action_controller.use_accept_header = true A special case remains for ajax requests which will have a javascript format for the base resource (/people/1) if the X-Requested-With header is present. This lets ajax pages still use format.js despite there being no params[:format]
* Added application/jsonrequest as a synonym for application/jsonMike Subelsky2008-07-021-4/+10
| | | | [#536 state:resolved]
* Fixed Request#remote_ip to only raise hell if the HTTP_CLIENT_IP and ↵David Heinemeier Hansson2008-06-031-0/+3
| | | | HTTP_X_FORWARDED_FOR doesnt match (not just if theyre both present) [Mark Imbriaco, Bradford Folkens]
* Automatically parse posted JSON content for Mime::JSON requests. [rick]Rick Olson2008-04-081-1/+22
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9242 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat: encoding and multibyte test fixesJeremy Kemper2008-04-011-2/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9194 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Avoid remote_ip spoofingJeremy Kemper2008-03-281-2/+23
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9124 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that ActionController::Base#read_multipart would fail if boundary was ↵David Heinemeier Hansson2008-03-281-1/+20
| | | | | | exactly 10240 bytes (closes #10886) [ariejan] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9113 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix more obscure nested parameter hash parsing bug. Closes #10797 [thomas.lee]Rick Olson2008-03-131-0/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9020 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix nested parameter hash parsing bug. #10797 [thomas.lee]Rick Olson2008-03-111-0/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9010 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix bug with setting Request#format= after the getter has cached the value. ↵Rick Olson2008-02-071-0/+7
| | | | | | Closes #10889 [cch1] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8811 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* require abstract_unit directly since test is in load pathJeremy Kemper2008-01-051-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8564 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat: file uploads. References #1689 [Frederick Cheung]Jeremy Kemper2007-12-271-1/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8492 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat: move from the deprecated Base64 module to ↵Jeremy Kemper2007-12-181-3/+3
| | | | | | ActiveSupport::Base64. Closes #10554. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8433 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added OPTIONS to list of default accepted HTTP methods (closes #10449) [holoway]David Heinemeier Hansson2007-12-171-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8425 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixes for standalone testsJeremy Kemper2007-12-151-0/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8406 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ignore illegal seeks on body rewind. Catches CGI errors depending on your ↵Jeremy Kemper2007-12-071-0/+10
| | | | | | httpd. Closes #10404 [Curtis Hawthorne] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8327 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Raise UnknownHttpMethod exception for unknown HTTP methods. Closes #10303 ↵Rick Olson2007-11-291-2/+17
| | | | | | [tarmo] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8235 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* memoize host with port and refactor the tests which depend on it changingMichael Koziarski2007-11-171-2/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8164 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed handling of non-domain hosts (closes #9479) [purp]David Heinemeier Hansson2007-11-071-0/+15
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8108 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Factor Integration::Runner behavior out of IntegrationTest. Introduce ↵Jeremy Kemper2007-11-011-2/+2
| | | | | | Session#request_count which counts processed requests. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8064 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* request.parameters doesn't overwrite request.request_parameters. Closes ↵Jeremy Kemper2007-10-221-0/+9
| | | | | | #9949 [nullstyle] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7992 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Use StringIO and Tempfile subclasses instead of defining singleton methods ↵Jeremy Kemper2007-10-061-12/+20
| | | | | | on each multipart field. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7759 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Rewind stdin if possible after multipart parsing.Jeremy Kemper2007-10-061-1/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7758 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add a user_agent to TestRequestMichael Koziarski2007-09-071-0/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7416 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that file.content_type for uploaded files would include a trailing \r ↵David Heinemeier Hansson2007-07-241-3/+3
| | | | | | #9053 [bgreenlee] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7212 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Give the legacy X-POST_DATA_FORMAT header greater precedence during params ↵Jeremy Kemper2007-06-261-0/+10
| | | | | | parsing for backward compatibility. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7126 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Tolerate missing content type on multipart file uploads. Fix for Safari 3.Jeremy Kemper2007-06-121-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7005 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* request.remote_ip understands X-Forwarded-For addresses with nonstandard ↵Jeremy Kemper2007-05-281-0/+3
| | | | | | whitespace. Closes #7386. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6877 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add multipart request parsing test with bracketed parameter key. References ↵Jeremy Kemper2007-05-241-0/+4
| | | | | | #8449. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6831 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Set RAW_POST_DATA when request parameters are parsed.Jeremy Kemper2007-05-231-9/+11
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6823 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Parse url-encoded and multipart requests ourselves instead of delegating to CGI.Jeremy Kemper2007-05-181-34/+392
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6764 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Move request parameter parsing from CGI to AbstractRequest.Jeremy Kemper2007-05-151-0/+36
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6742 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* The default respond_to blocks don't set a specific extension anymore, so ↵Rick Olson2007-04-121-3/+9
| | | | | | that both 'show.rjs' and 'show.js.rjs' will work. [Rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6517 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ignore odd charset declaration in CONTENT_TYPE header which would throw off ↵Tobias Lütke2007-03-051-0/+19
| | | | | | mime type lookup. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6340 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Recognize the .txt extension as Mime::TEXT [Rick]Rick Olson2007-01-121-0/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5912 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Set request.env['REQUEST_URI'] when absent.Jeremy Kemper2007-01-121-7/+13
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5895 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Request#format to return the format used for the request as a mime ↵David Heinemeier Hansson2006-12-021-0/+12
| | | | | | type. If no format is specified, the first Request#accepts type is used. This means you can stop using respond_to for anything else than responses [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5664 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* * Added GET-masquarading for HEAD, so request.method will return :get even ↵David Heinemeier Hansson2006-11-231-3/+10
| | | | | | for HEADs. This will help anyone relying on case request.method to automatically work with HEAD and map.resources will also allow HEADs to all GET actions. Rails automatically throws away the response content in a reply to HEAD, so you dont even need to worry about that. If you, for whatever reason, still need to distinguish between GET and HEAD in some edge case, you can use Request#head? and even Request.headers["REQUEST_METHOD"] for get the "real" answer. Closes #6694 [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5621 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix relative URL root matching problemsJamis Buck2006-10-091-0/+10
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5272 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Restrict Request Method hacking with ?_method to POST requests. [Rick Olson]Rick Olson2006-08-011-1/+29
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4644 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add ability for relative_url_root to be specified via an environment ↵Nicholas Seckar2006-03-181-0/+13
| | | | | | variable RAILS_RELATIVE_URL_ROOT. Closes #4243. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3931 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that SSL would not correctly be detected when running lighttpd/fcgi ↵David Heinemeier Hansson2006-01-231-0/+12
| | | | | | behind lighttpd w/mod_proxy (closes #3548) [stephen_purcell@yahoo.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3467 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* More robust relative url root discovery for SCGI compatibility. This solves ↵Jeremy Kemper2005-12-081-0/+5
| | | | | | the 'SCGI routes problem' -- you no longer need to prefix all your routes with the name of the SCGI mountpoint. References #3070. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3237 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix Request#host_with_port to use the standard port when Rails is behind a ↵Nicholas Seckar2005-10-151-4/+0
| | | | | | proxy. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2596 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that Request#domain caused an exception if the domain header wasn't ↵David Heinemeier Hansson2005-09-201-0/+6
| | | | | | set in the original http request #1795 [Michael Koziarski] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2270 5ecf4fe2-1ee6-0310-87b1-e25e094e27de