Skip to content

Commit

Permalink
Remove methods from public API that users can't call
Browse files Browse the repository at this point in the history
Those methods have private visibility , so they can't be called from
outside the class, so they should not be in the public API.
  • Loading branch information
rafaelfranca committed Mar 25, 2022
1 parent 996980e commit aa5a4a7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions actionpack/lib/action_dispatch/http/mime_negotiation.rb
Expand Up @@ -172,22 +172,22 @@ def should_apply_vary_header?
# in which case we assume you're a browser and send HTML.
BROWSER_LIKE_ACCEPTS = /,\s*\*\/\*|\*\/\*\s*,/

def params_readable? # :doc:
def params_readable?
parameters[:format]
rescue *RESCUABLE_MIME_FORMAT_ERRORS
false
end

def valid_accept_header # :doc:
def valid_accept_header
(xhr? && (accept.present? || content_mime_type)) ||
(accept.present? && !accept.match?(BROWSER_LIKE_ACCEPTS))
end

def use_accept_header # :doc:
def use_accept_header
!self.class.ignore_accept_header
end

def format_from_path_extension # :doc:
def format_from_path_extension
path = get_header("action_dispatch.original_path") || get_header("PATH_INFO")
if match = path && path.match(/\.(\w+)\z/)
Mime[match.captures.first]
Expand Down

0 comments on commit aa5a4a7

Please sign in to comment.