Commit Graph

2263 Commits

Author SHA1 Message Date
Joshua Peek
1f72700575 Move default middleware stack into initializer 2009-09-26 13:41:32 -05:00
Yehuda Katz + Carl Lerche
f0dd77c6be Move railties/lib/* into railties/lib/* 2009-09-24 16:11:41 -07:00
Joshua Peek
9f96708f53 Resurrect AC::Benchmarking [#3140 state:resolved] 2009-09-24 12:13:09 -05:00
Joshua Peek
3fb623fa90 SessionRestoreError belongs in AD 2009-09-23 23:37:31 -05:00
Joshua Peek
542ddde5d4 Move helpers specific to functional tests out of TestProcess into AC::TestCase 2009-09-23 23:03:24 -05:00
Joshua Peek
4a55d1de8d Move integration test runner into ActionDispatch 2009-09-23 22:38:19 -05:00
José Valim
a0233dd3b2 Use NewCallbacks on ActionDispatch::Callbacks. 2009-09-20 10:56:38 -03:00
José Valim
7cc1c2e71d Add Orchestra instrumentation to fragment and page caching. 2009-09-20 10:56:38 -03:00
Joshua Peek
90d7ae23c6 Remove global exception catching from ApplicationController.
It was severely broken since it was ported to NewBase and is causing problems with normal exception catching. A replacement is coming soon.
2009-09-15 10:05:46 -05:00
Jeremy Kemper
af68eb99c1 Uses extlib_inheritable_accessor 2009-09-14 13:04:43 -07:00
Joshua Peek
8491b77f55 Omit PATH_INFO in integration test so rack mock will properly override it 2009-09-13 17:15:35 -05:00
Yehuda Katz
76cd4cb27e Memoize in the endpoint. 2009-09-12 15:38:34 -05:00
Yehuda Katz
7152a4e9a6 Add per-controller middleware 2009-09-12 13:51:15 -05:00
Nathaniel Talbott
f024aabee3 Fix filtering parameters when there are Fixnum or other un-dupable values.
[#3184 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-09-10 18:53:50 -07:00
Joshua Peek
c531bd6665 Cleanup hacky routing with controller_path in url helper tests. This doesn't work in real life anyway. 2009-09-06 22:29:29 -05:00
Yehuda Katz + Carl Lerche
e3744166ec Refactor ActionController to use find_template and template_exists? 2009-09-03 12:52:53 -07:00
Yehuda Katz + Carl Lerche
f3fc5c4b5f Refactor ActionView::Resolver 2009-09-03 11:18:57 -07:00
Joshua Peek
a79790e1a5 rack-test 0.4.2 has rack 1.1.pre goodies, we'll use it instead 2009-08-31 23:08:20 -05:00
Joshua Peek
5e5e34377c Back off rack 1.1-pre and bundle in the new testing goodies 2009-08-31 15:39:19 -05:00
José Valim
3f78de67b5 Ensure that blocks are also handled inside the responder. 2009-08-29 18:21:19 +02:00
José Valim
684a6b3c71 Attempt to render the template inside the responder, so it can be used for caching and pagination.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-08-29 11:01:00 -05:00
Joshua Peek
ba5995dcd9 Reset session in integration tests after changing routes to reload the middleware stack 2009-08-27 12:43:26 -05:00
Carl Lerche
4467fa7d24 Fixed stupid mistake... nothing to see here. 2009-08-26 20:51:54 -07:00
Carl Lerche
2890760665 Set the request and response in ActionController::Middleware 2009-08-26 19:52:18 -07:00
Jeffrey Hardy
05b529ca57 UrlRewriter#rewrite_url should call #to_param on the value given in :anchor option, just as #url_for does
[#2746 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-26 14:11:26 -07:00
Yehuda Katz
9408fcd2e8 Create new ActionController::Middleware class that will work as a normal Rack middleware.
* This initial implementation is a bit hackish, but it uses a normal middleware API
    so it's future-proof when we improve the internals.
2009-08-26 00:18:52 -07:00
Yehuda Katz + Carl Lerche
5bc66f160d And the same thing for Basic 2009-08-25 17:34:07 -07:00
Yehuda Katz + Carl Lerche
3a5269eba4 HTTP Auth should not depend on RenderingController 2009-08-25 17:29:48 -07:00
Yehuda Katz + Carl Lerche
303f9b8841 Redirector had an undeclared dependency on Logger. 2009-08-25 17:20:58 -07:00
Yehuda Katz + Carl Lerche
469424c85e Modify Digest and Basic to take a request so they can be used outside of the controller 2009-08-25 16:02:26 -07:00
Yehuda Katz + Carl Lerche
c7ba911a43 ActionController::Metal can be a middleware 2009-08-25 12:14:31 -07:00
Joshua Peek
b58acea569 Move legacy param_parsers config onto AD::ParamsParser 2009-08-21 16:49:33 -05:00
Joshua Peek
24ad9ae3d2 Cleanup route reloading in tests. Prefer with_routing over using ActionController::Routing::Routes directly 2009-08-16 21:14:26 -05:00
Joshua Peek
911acc10de Axe "best fit" generation support 2009-08-15 18:08:46 -05:00
Jeremy Kemper
df6617bc8a Normalize route generation order: associations, yield block, then own routes. 2009-08-15 15:56:52 -07:00
Yehuda Katz
1310231c15 Got tests to pass with some more changes.
* request.formats is much simpler now
    * For XHRs or Accept headers with a single item, we use the Accept header
    * For other requests, we use params[:format] or fallback to HTML
    * This is primarily to work around the fact that browsers provide completely
      broken Accept headers, so we have to whitelist the few cases we can
      specifically isolate and treat other requests as coming from the browser
    * For APIs, we can support single-item Accept headers, which disambiguates
      from the browsers
  * Requests to an action that only has an XML template from the browser will
    no longer find the template. This worked previously because most browsers
    provide a catch-all */*, but this was mostly accidental behavior. If you
    want to serve XML, either use the :xml format in links, or explicitly
    specify the XML template: render "template.xml".
2009-08-15 12:32:02 -07:00
Yehuda Katz
9b552fb300 Caches and cache clearing seems to actually work, but the actual architecture is kind of messy. Next: CLEAN UP. 2009-08-15 12:32:01 -07:00
José Valim
8692b11e81 Merge branch 'master' of git://github.com/rails/rails 2009-08-13 10:27:53 +02:00
José Valim
4f9047ecc8 Ensure collections are not treated as nested resources. 2009-08-13 10:27:41 +02:00
Yehuda Katz
4bf516e072 More perf work:
* Move #set_cookie and #delete_cookie inline to optimize. These optimizations should
    almost certainly be sent back upstream to Rack. The optimization involves using
    an ivar for cookies instead of indexing into the headers each time.
  * Was able to use a bare Hash for headers now that cookies have their own joining
    semantics (some code assumed that the raw cookies were an Array).
  * Cache blankness of body on body=
  * Improve expand_cache_key for Arrays of a single element (common in our case)
  * Use a simple layout condition check unless conditions are used
  * Cache visible actions
  * Lazily load the UrlRewriter
  * Make etag an ivar that is set on prepare!
2009-08-11 15:03:53 -07:00
Yehuda Katz
0adbeeb0c9 Got overhead down from 127 to 85. All tests pass:
* Tentatively replaced HeaderHash with SimpleHeaderHash, which does not preserve
    case but does handle converting Arrays to Strings in to_hash. This requires
    further discussion.
  * Moved default_charset to ActionDispatch::Response to avoid having to hop over
    to ActionController. Ideally, this would be a constant on AD::Response, but
    some tests expect to be able to change it dynamically and I didn't want to change
    them yet.
  * Completely override #initialize from Rack::Response. Previously, it was creating
    a HeaderHash, and then we were creating an entirely new one. There is no way to
    call super without incurring the overhead of creating a HeaderHash.
  * Override #write from Rack::Response. Its implementation tracks Content-Length,
    and doing so adds additional overhead that could be mooted if other middleware
    changes the body. It is more efficiently done at the top-level server.
  * Change sending_file to an instance_variable instead of header inspection. In
    general, if a state is important, it should be set as a property of the response
    not reconstructed later.
  * Set the Etag to @body instead of .body. AS::Cache.expand_cache_key handles
    Arrays fine, and it's more efficient to let it handle the body parts, since
    it is not forced to create a joined String.
  * If we detect the default cache control case, just set it, rather than setting
    the constituent parts and then running the normal (expensive) code to generate
    the string.
2009-08-11 15:03:53 -07:00
Joshua Peek
734e903af5 Deprecate router generation "best match" sorting 2009-08-09 22:53:16 -05:00
Hugo Peixoto
202b091373 Added both the documentation and a test case for the collection path name customization feature.
[#1218 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 14:26:36 -07:00
Bence Nagy
e1b73b9752 path_names could be used to customize collection actions too
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 14:26:36 -07:00
Gabe da Silveira
1185500ff0 Remove unused routeset method routes_for_controller_and_action in favour for routes_for [#3023 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-09 18:02:35 +01:00
Felipe Talavera
654568e71b Allow to configure trusted proxies via ActionController::Base.trusted_proxies [#2126 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-09 16:56:18 +01:00
José Valim
32bde66aa6 Make http digest work with different server/browser combinations
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-09 15:53:52 +01:00
Yehuda Katz
e28e061165 Use response_body rather than performed? 2009-08-09 04:12:09 -03:00
Jan Schwenzien
1f6afe4a74 Fix HTTP basic authentication for long credentials [#2572 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-09 01:28:43 +01:00
Niklas Holmgren
c284412b14 Polymorphic routes generates collection URL from model class [#1089 state:resolved]
Signed-off-by: Dan Pickett <dpickett@enlightsolutions.com>
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-08 17:00:29 +01:00