aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/middleware
Commit message (Collapse)AuthorAgeFilesLines
* Improve RDoc documentation of ActionDispatch::SSLTim Rogers2015-12-241-12/+14
|
* Add #== back to ActionDispatch::MiddlewareStack::MiddlewareJon Moss2015-12-211-0/+9
| | | | | This was causing bug #22738 to occur. Also added extra tests to make sure everything is A-OK.
* Refer to rails command instead of rake in a bunch of placesDavid Heinemeier Hansson2015-12-181-1/+1
| | | | Still more to do. Please assist!
* Avoid warning because of the mime typeJorge Bejar2015-12-091-1/+1
|
* DebugException initialize with a response_format valueJorge Bejar2015-12-091-6/+7
|
* Better name for method in DebugExceptions middlewareJorge Bejar2015-12-091-2/+2
|
* Minor cleanup in AD::DebugExceptionsJorge Bejar2015-12-091-6/+9
|
* Remove unneeded args in AD::DebugExceptionsJorge Bejar2015-12-091-1/+0
|
* New hash syntax in AD::DebugExceptionsJorge Bejar2015-12-091-4/+4
|
* Fix some edge cases in AD::DebugExceptions in rails api appsJorge Bejar2015-12-091-41/+64
|
* Response when error should be formatted properly in Rails API if local requestJorge Bejar2015-12-091-2/+15
|
* Stop violating law of demeter in response cookie_jareileencodes2015-12-061-0/+6
| | | | | | | | | | | This adds a new method to request and response so we don't need to violate the law of demeter. We are changing `Request` and `Response` so that they always have a `cookie_jar` This is a continuation on work to combine integration and controller test code bases in Rails.
* Merge pull request #22172 from tijmenb/fix-source-in-show-exceptionRafael França2015-11-242-0/+8
|\ | | | | Add text template for source code
| * Add text template for source codeTijmen Brommet2015-11-032-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a request is made with AJAX and an error occurs, Rails will render a text-template for the exception instead of the HTML error page (#11960). The `.text.erb` variant of the `_source` template is currently missing, causing HTML to be rendered in the response. This commit adds the text template. To keep the page scannable we only only show the first three source extracts. Related to #14745. Before: ``` ~/testing-exceptions ᐅ curl 'http://localhost:3000/' -H 'X-Requested-With: XMLHttpRequest' RuntimeError in PostsController#index <div class="source " id="frame-source-0"> <div class="info"> Extracted source (around line <strong>#3</strong>): </div> <div class="data"> <table cellpadding="0" cellspacing="0" class="lines"> <tr> ``` After: ``` ~/testing-exceptions ᐅ curl 'http://localhost:3000/' -H 'X-Requested-With: XMLHttpRequest' RuntimeError in PostsController#index Extracted source (around line #3): *3 raise ```
* | Clearer comment and variable name on IP spoofingGrey Baker2015-11-221-7/+15
| |
* | Add missing example for cookies.encrypted [ci skip]Nicolas Cavigneaux2015-11-201-0/+7
| |
* | Merge pull request #22259 from daisuko/remove_compiled_root_from_static_rbYves Senn2015-11-121-1/+0
|\ \ | | | | | | remove unnecessary @compiled_root from static.rb
| * | remove unnecessary @compiled_root from static.rbdaisuko2015-11-111-1/+0
| |/
* / Show middleware classes on /rails/info/propertiesclaudiob2015-11-111-1/+5
|/ | | | | | | Closes #21230 by following the indication of @rafaelfranca: > I think the output change would be simpler. > What is really important to show is the class of the middleware, so we should change the output to show that.
* Deprecate exception#original_exception in favor of exception#causeYuki Nishijima2015-11-035-19/+37
|
* Delete needless `require 'active_support/deprecation'`yui-knk2015-10-201-2/+0
| | | | | When `require 'active_support/rails'`, 'active_support/deprecation' is automatically loaded.
* Merge pull request #19135 from yuki24/access-control-supportJeremy Daer2015-10-131-8/+14
|\ | | | | | | Add basic support for access control headers to ActionDispatch::Static
| * Add the ability of returning arbitrary headers to ActionDispatch::StaticYuki Nishijima2015-06-131-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now ActionDispatch::Static can accept HTTP headers so that developers will have control of returning arbitrary headers like 'Access-Control-Allow-Origin' when a response is delivered. They can be configured through `#config.public_file_server.headers`: config.public_file_server.headers = { "Cache-Control" => "public, max-age=60", "Access-Control-Allow-Origin" => "http://rubyonrails.org" } Also deprecate `config.static_cache_control` in favor of `config.public_file_server.headers`.
* | Don't set a nil Set-Cookie header when there aren't any cookies. Omit the ↵Jeremy Daer2015-10-011-1/+3
| | | | | | | | header.
* | inherit from our AbstractStoreAaron Patterson2015-09-251-5/+1
| |
* | pull the flash methods in to their own moduleAaron Patterson2015-09-251-34/+38
| | | | | | | | | | | | We only want to activate flash when the user has enabled it. Api servers don't use flash, so add an empty implementation to the base Request object.
* | commit the flash after the controller finishes being servicedAaron Patterson2015-09-251-10/+16
| | | | | | | | | | Committing the flash needs to happen in order for the session to be written correctly, so lets guarantee that it actually does happen.
* | move flash committing to the request object.Aaron Patterson2015-09-251-12/+1
| | | | | | | | | | I'm doing this so that we can commit the flash to the session object Out of Band of the flash middleware
* | build the Set-Cookie header functionallyAaron Patterson2015-09-241-5/+18
| | | | | | | | | | Use the Rack utility methods for functional header manipulation. This helps to eliminate coupling on the header hash
* | ask the request object for the sessionAaron Patterson2015-09-221-1/+1
| | | | | | | | | | The flash middleware shouldn't know how to look up the session object. Just ask the request for that information.
* | TypppoAkira Matsuda2015-09-211-3/+3
| |
* | do not instantiate a param parser middlewareAaron Patterson2015-09-181-6/+2
| | | | | | | | | | | | we don't actually need a param parser middleware instance since the request object will take care of parsing parameters for us. For now, we'll just configure the parameter parsers on the request in this class.
* | push the parameter parsers on to the classAaron Patterson2015-09-181-12/+2
| | | | | | | | | | | | | | | | The middleware stack is a singleton in the application (one instance is shared for the entire application) which means that there was only one opportunity to set the parameter parsers. Since there is only one set of parameter parsers in an app, lets just configure them on the request class (since that is where they are used).
* | stop eagerly parsing parametersAaron Patterson2015-09-181-2/+0
| | | | | | | | | | Parameters will not be parsed until they are specifically requested via the `request_parameters` method.
* | pull `normalize_encode_params` upAaron Patterson2015-09-181-2/+1
| | | | | | | | | | `normalize_encode_params` is common to all parser code paths, so we can pull that up and always apply it before assigning the request parameters
* | move parameter parsing to the request objectAaron Patterson2015-09-181-21/+3
| | | | | | | | | | All parameter parsing should be on the request object because the request object is the object that we ask for parameters.
* | Fix HSTS default expire in ActionDispatch::SSL docs.Pedro Nascimento2015-09-141-1/+2
| |
* | Update documentation to reflect Rack::Session::Abstract changeseileencodes2015-09-091-1/+1
| | | | | | | | | | `Rack::Session::Abstract::ID` is now deprecated and `Rack::Session::Abstract::Persisted` should be used instead.
* | Push key_generator into SerializedCookieJarsKasper Timm Hansen2015-09-081-4/+4
| | | | | | | | It's only used there.
* | Move the request method in to the AbstractCookieJarKasper Timm Hansen2015-09-081-4/+3
| | | | | | | | | | `CookieJar` is only at the start of the chain and has its own request method, so we don't need it in the module.
* | Pull up parse to the legacy upgrading moduleKasper Timm Hansen2015-09-081-10/+5
| | | | | | | | It was the same in both legacy versions of the signed and encrypted cookie jars.
* | Call super to remove the decrypt_and_verify methodKasper Timm Hansen2015-09-081-8/+4
| | | | | | | | The `EncryptedCookieJar` already calls it for us, so just delegate to its `parse` implementation.
* | Call super to remove the verify methodKasper Timm Hansen2015-09-081-8/+2
| | | | | | | | | | `SignedCookieJar`'s parse method already attempts to verify the message, so we can just call super and try the old verifier if it fails.
* | Add parse method to share deserialization logic.Kasper Timm Hansen2015-09-081-19/+12
| | | | | | | | Cuts down on the duplicated reading parts.
* | Add commit in the EncryptedCookieJarKasper Timm Hansen2015-09-081-17/+7
| | | | | | | | Gets rid of the option parsing and makes what the encryptor does stand out.
* | Use commit in the SignedCookieJarKasper Timm Hansen2015-09-081-15/+6
| | | | | | | | Lets us avoid worrying about parsing the options and doing just what we need.
* | Add commit method to share option normalizationKasper Timm Hansen2015-09-081-4/+12
| | | | | | | | Remove the clutter to make PermanentCookieJar's one change stand out.
* | Add AbstractCookieJar class.Kasper Timm Hansen2015-09-081-1/+3
| | | | | | | | Eventually this will be the superclass of all the chained jars.
* | Make `config.force_ssl` less dangerous to try and easier to disableJeremy Daer2015-09-071-36/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SSL redirect: * Move `:host` and `:port` options within `redirect: { … }`. Deprecate. * Introduce `:status` and `:body` to customize the redirect response. The 301 permanent default makes it difficult to test the redirect and back out of it since browsers remember the 301. Test with a 302 or 307 instead, then switch to 301 once you're confident that all is well. HTTP Strict Transport Security (HSTS): * Shorter max-age. Shorten the default max-age from 1 year to 180 days, the low end for https://www.ssllabs.com/ssltest/ grading and greater than the 18-week minimum to qualify for browser preload lists. * Disabling HSTS. Setting `hsts: false` now sets `hsts: { expires: 0 }` instead of omitting the header. Omitting does nothing to disable HSTS since browsers hang on to your previous settings until they expire. Sending `{ hsts: { expires: 0 }}` flushes out old browser settings and actually disables HSTS: http://tools.ietf.org/html/rfc6797#section-6.1.1 * HSTS Preload. Introduce `preload: true` to set the `preload` flag, indicating that your site may be included in browser preload lists, including Chrome, Firefox, Safari, IE11, and Edge. Submit your site: https://hstspreload.appspot.com
* | implement abstract store methodsAaron Patterson2015-09-042-5/+5
| | | | | | | | converts old ID methods to the new abstract store methods in Rack