aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/middleware
Commit message (Collapse)AuthorAgeFilesLines
* Don't reference Rails.application from inside a componentMatthew Draper2016-03-021-10/+6
|
* Publish AS::Executor and AS::Reloader APIsMatthew Draper2016-03-024-78/+47
| | | | | | These should allow external code to run blocks of user code to do "work", at a similar unit size to a web request, without needing to get intimate with ActionDipatch.
* Drop Action Controller require in ActionDispatch::ExceptionWrapperGenadi Samokovarov2016-02-291-1/+0
| | | | | | | | | | | | We only reference the Action Controller error classes by name in ActionDispatch::ExceptionWrapper, so there is no need to explicitly require them. It drops a tiny coupling between Action Dispatch and Action Controller, so it makes me feel warm inside. We still have a lot of others AC requires in the AD code base, but here, we can save it. [ci skip]
* add `constraint_to` option to SSL middlewareGreg Molnar2016-02-281-2/+6
|
* :nail_care:Rafael Mendonça França2016-02-251-2/+2
|
* Update documentation and deprecation messagePrathamesh Sonpatki2016-02-251-3/+3
|
* Added deprecation for older appsPrathamesh Sonpatki2016-02-251-1/+12
| | | | | | | | - For old apps which are not setting any value for hsts[:subdomains], a deprecation warning will be shown saying that hsts[:subdomains] will be turned on by default in Rails 5.1. Currently it will be set to false for backward compatibility. - Adjusted tests to reflect this change.
* HSTS without IncludeSubdomains is often uselessEgor Homakov2016-02-251-1/+1
| | | | | | | | 1) Because if you forget to add Secure; to the session cookie, it will leak to http:// subdomain in some cases 2) Because http:// subdomain can Cookie Bomb/cookie force main domain or be used for phishing. That's why *by default* it must include subdomains as it's much more common scenario. Very few websites *intend* to leave their blog.app.com working over http:// while having everything else encrypted. Yes, many developers forget to add subdomains=true by default, believe me :)
* Transform the mime object to symbol when registering the parsersRafael Mendonça França2016-02-221-0/+1
| | | | | This will keep our current API working without having the users to change their codebases.
* Fix code styleRafael Mendonça França2016-02-171-3/+4
| | | | This change was added in #23203 and it was not conforming our code style.
* Merge pull request #23203 from vipulnsward/22979-show-tags-on-exceptionRichard Schneeman2016-02-161-7/+11
|\ | | | | WIP: Errors in logs should show log tags as well.
| * WIP: Errors in logs should show log tags as well.Vipul A M2016-02-121-7/+11
| | | | | | | | | | | | | | - Changed formatted_code_for to return array of logs to be tagged for each line - Changed some render tests to match new behaviour of return Fixes #22979
* | Join values using '; ' as per RFC specAndrew White2016-02-161-1/+1
| | | | | | | | | | | | | | Multiple cookie values should be separated by '; ' according to RFC 6265, section 5.4.4[1]. [1]: https://tools.ietf.org/html/rfc6265#section-5.4
* | Add require and move escape to private methodAndrew White2016-02-161-1/+6
| |
* | Merge branch 'should-escape-cookie' of https://github.com/ma2gedev/rails ↵Andrew White2016-02-161-1/+1
|\ \ | | | | | | | | | into ma2gedev-should-escape-cookie
| * | Escape cookie's key and value in ActionController::TestCaseTakayuki Matsubara2015-12-301-1/+1
| | | | | | | | | | | | | | | Get an incorrect cookie value in controller action method if cookie value contains an escapable string.
* | | Corrected secret_key_basevs4vijay2016-02-151-1/+1
| |/ |/|
* | Revert "Its ideal to set Vary: Accept-Encoding, irrespective of whether ↵schneems2016-01-191-1/+1
| | | | | | | | | | | | | | | | gzipped version exists or not. This is helpful for CDN's to later distinguish assets, based on previous, current copies and introduced gzip version if any." This reverts commit 067c52f608568e35181830a5c1016e382650e655. Conversation: https://github.com/rails/rails/pull/23120#issuecomment-173007011
* | Its ideal to set Vary: Accept-Encoding, irrespective of whether gzipped ↵Vipul A M2016-01-191-1/+1
| | | | | | | | | | | | | | | | version exists or not. This is helpful for CDN's to later distinguish assets, based on previous, current copies and introduced gzip version if any. For ref: https://www.fastly.com/blog/best-practices-for-using-the-vary-header This change sets `Vary` header always, to be on safer side
* | Prevent attempt to serve a request with a null byteJordan Owens2016-01-121-1/+5
| | | | | | | | | | | | File paths cannot contain null byte characters and methods that do path operations such as Rack::Utils#clean_path_info will raise unwanted errors.
* | Flexible configuration for ActionDispatch::SSLTim Rogers2015-12-291-8/+12
|/
* 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