aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/metal/head.rb
Commit message (Collapse)AuthorAgeFilesLines
* Reduce method invocations and object allocations in head()Akira Matsuda2019-07-311-1/+1
|
* Merge pull request #28937 from maclover7/jm-fix-28927Rafael França2018-07-311-1/+1
|\ | | | | Default content type for `head` is `text/html`
| * Default content type for `head` is `text/html`Jon Moss2017-04-301-1/+1
| | | | | | | | Otherwise Mime::NullType will be returned as the `Content-Type` header.
* | Use frozen string literal in actionpack/Kir Shatrov2017-07-291-0/+2
| |
* | Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | | | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* | Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|/
* `self.` is not needed when calling its own instance methodAkira Matsuda2017-01-051-1/+1
| | | | Actually, private methods cannot be called with `self.`, so it's not just redundant, it's a bad habit in Ruby
* Remove deprecated support for status option in headRafael Mendonça França2016-10-091-7/+1
|
* code gardening: removes redundant selfsXavier Noria2016-08-081-1/+1
| | | | | | | | | A few have been left for aesthetic reasons, but have made a pass and removed most of them. Note that if the method `foo` returns an array, `foo << 1` is a regular push, nothing to do with assignments, so no self required.
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-9/+9
|
* applies new string literal convention in actionpack/libXavier Noria2016-08-061-2/+2
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Fix nodoc to internal class error document some of themVipul A M2016-01-251-1/+0
| | | | | | | [ci skip] Fixes #20808 [Vipul A M & Julio Lopez]
* remove useless status setAaron Patterson2015-08-261-2/+0
| | | | | | Now that `Controller#status=` just delegates to the response object, we don't need to set the response on the controller and the response. We can just set it in one place.
* remove useless conditionalAaron Patterson2015-08-261-1/+1
| | | | we always have a response object, so there is no reason to test it
* provide a request and response to all controllersAaron Patterson2015-08-251-3/+2
| | | | | | | | | | Controllers should always have a request and response when responding. Since we make this The Rule(tm), then controllers don't need to be somewhere in limbo between "asking a response object for a rack response" or "I, myself contain a rack response". This duality leads to conditionals spread through the codebase that we can delete: * https://github.com/rails/rails/blob/85a78d9358aa728298cd020cdc842b55c16f9549/actionpack/lib/action_controller/metal.rb#L221-L223
* :snip: whitespaceAaron Patterson2015-08-251-2/+2
|
* Deprecate passing hash as first parameter into ActionController::HeadMehmet Emin İNAÇ2015-06-151-2/+12
|
* Return true from head methodJoel Hayhurst2015-03-121-0/+2
| | | | | | It was returning false in normal circumstances. This broke the `head :ok and return if` construct. Add appropriate test.
* Correctly use the response's status code calling headRobin Dupret2014-12-311-1/+1
| | | | | | | | | | | | | | | | Commit 20fece1 introduced the `_status_code` method to fix calls to `head :ok`. This method has been added on both ActionController::Metal and ActionDispatch::Response. As for the latter, this method is just equivalent to the `response_code` one so commit aefec3c removed it from the `Reponse` object so call to the `_status_code` method on an ActionController::Base instance would be handled by the `Metal` class (which `Base` inherits from) but the status code is not updated according to the response at this level. The fix is to actually rely on `response_code` for ActionController::Base instances but this method doesn't exist for bare Metal controllers so we need to define it.
* Remove single space response body for head requestPrathamesh Sonpatki2014-12-301-2/+2
| | | | | | | | | | | | | | - The single space response was added due to a bug in safari in https://github.com/rails/rails/commit/cb0f8fda9652c4d24d04693bdb82cecd3b067e5c and https://github.com/rails/rails/commit/807df4fcf021fc4d15972aa1c17ba7398d43ab0d. - This was removed from the `render nothing: true` in https://github.com/rails/rails/pull/14883. - Removing it from response of :head also. As :head is more obvious alternative to call `render nothing: true`(http://guides.rubyonrails.org/layouts_and_rendering.html#using-head-to-build-header-only-responses), removing it from head method also. - Closes #18253.
* docs, add ref where to find valid `head` status symbols.Yves Senn2014-07-251-0/+2
| | | | [ci skip]
* fixes stack level too deep exception on action named 'status' returning ↵Christiaan Van den Poel2014-05-151-1/+1
| | | | 'head :ok'
* Typos. return -> returns. [ci skip]Lauro Caetano2013-12-031-1/+1
|
* Removing ActiveSupport::Concern, it's not neededAttila Domokos2013-09-131-2/+0
|
* charset should not be appended for `head` responsesYves Senn2012-12-311-0/+1
| | | | | | | 1) Failure: test_head_created_with_image_png_content_type(RenderTest) [test/controller/render_test.rb:1238]: Expected: "image/png" Actual: "image/png; charset=utf-8"
* Multiple changes to 1,9 hash syntaxAvnerCohen2012-10-271-2/+2
|
* Collapsed dual checks (one for content headers and one for content) into a ↵Armand du Plessis2012-08-021-4/+4
| | | | | | | | | | | | single check. Rails includes a single character body to a head(:no_content) response to work around an old Safari bug where headers were ignored if no body sent. This patch brings the behavior slightly closer to spec if :no_content/204 is explicity requested via a head only response. Status comparison done on symbolic and numeric values Not returning any content when responding with head and limited to a status code that explicitly states no content will be returned - 100..199, 204, 205, 304.
* If content_type is explicitly passed to the :head method use the value or ↵Kunal Shah2012-05-081-1/+2
| | | | fallback
* Remove content-length as welltwinturbo2012-05-031-2/+3
|
* Make ActionController#head pass rack-linktwinturbo2012-05-031-1/+20
|
* Add ActionController#head exampleAlexey Vakhov2011-10-111-0/+2
|
* Fix a few bugs when trying to use Head standalonewycats2010-10-101-4/+2
|
* Fix header capitalization by explicitly upcasing first letter of every word, ↵Maxim Chernyak2010-09-181-1/+1
| | | | and avoiding capitalize. [#5636 state:resolved]
* Including UrlFor in Redirecting and Head will warn usefully if a controller ↵Carlhuda2010-02-261-3/+2
| | | | is wired up without a router included (and still support redirect_to "omg")
* WIP: Remove the global routerCarlhuda2010-02-251-1/+3
|
* Remove duplicated url_for code and move methods shared between ActionMailer ↵José Valim2010-01-071-1/+2
| | | | and ActionController up to AbstractController.
* AC::Head now doesn't have an unfulfilled Rendering dependency, and instead ↵Yehuda Katz2009-12-201-1/+6
| | | | works just fine standalone (which means that ConditionalGet also doesn't have a Rendering dependency)
* Extract #head into its own module and simplify itYehuda Katz2009-10-261-0/+27