Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing headers to Action Pack docs [ci-skip] #48005

Merged
merged 1 commit into from
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions actionpack/lib/abstract_controller/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ def corrections # :nodoc:
end
end

# = AbstractController \Base
#
# AbstractController::Base is a low-level API. Nobody should be
# using it directly, and subclasses (like ActionController::Base) are
# expected to provide their own +render+ method, since rendering means
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/abstract_controller/caching/fragments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

module AbstractController
module Caching
# = AbstractController Caching \Fragments
#
# Fragment caching is used for caching various blocks within
# views without caching the entire action as a whole. This is
# useful when certain elements of an action change frequently or
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_controller/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
require "action_controller/log_subscriber"

module ActionController
# = Action \Controller \Base
#
# API Controller is a lightweight version of ActionController::Base,
# created for applications that don't require all functionalities that a complete
# \Rails controller provides, allowing you to create controllers with just the
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_controller/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
require "action_controller/metal/params_wrapper"

module ActionController
# = Action Controller \Base
#
# Action Controllers are the core of a web request in \Rails. They are made up of one or more actions that are executed
# on request and then either it renders a template or redirects to another action. An action is defined as a public method
# on the controller, which will automatically be made accessible to the web-server through \Rails Routes.
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_controller/caching.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

module ActionController
# = Action Controller \Caching
#
# \Caching is a cheap way of speeding up slow applications by keeping the result of
# calculations, renderings, and database calls around for subsequent requests.
#
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_controller/form_builder.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

module ActionController
# = Action Controller Form Builder
#
# Override the default form builder for all views rendered by this
# controller and any of its descendants. Accepts a subclass of
# ActionView::Helpers::FormBuilder.
Expand Down
4 changes: 4 additions & 0 deletions actionpack/lib/action_controller/metal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
require "action_dispatch/middleware/stack"

module ActionController
# = Action Controller \MiddlewareStack
#
# Extend ActionDispatch middleware stack to make it aware of options
# allowing the following syntax in controllers:
#
Expand Down Expand Up @@ -58,6 +60,8 @@ def build_middleware(klass, args, block)
end
end

# = Action Controller \Metal
#
# <tt>ActionController::Metal</tt> is the simplest possible controller, providing a
# valid Rack interface without the additional niceties provided by
# ActionController::Base.
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_controller/metal/data_streaming.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
require "action_dispatch/http/content_disposition"

module ActionController # :nodoc:
# = Action Controller Data Streaming
#
# Methods for sending arbitrary data and for streaming files to the browser,
# instead of rendering.
module DataStreaming
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_controller/metal/default_headers.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

module ActionController
# = Action Controller Default Headers
#
# Allows configuring default headers that will be automatically merged into
# each response.
module DefaultHeaders
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_controller/metal/etag_with_flash.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

module ActionController
# = Action Controller Etag With Flash
#
# When you're using the flash, it's generally used as a conditional on the view.
# This means the content of the view depends on the flash. Which in turn means
# that the ETag for a response should be computed with the content of the flash
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

module ActionController
# = Action Controller Etag With Template Digest
#
# When our views change, they should bubble up into HTTP cache freshness
# and bust browser caches. So the template digest for the current action
# is automatically included in the ETag.
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_controller/metal/implicit_render.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

module ActionController
# = Action Controller Implicit Render
#
# Handles implicit rendering for a controller action that does not
# explicitly respond with +render+, +respond_to+, +redirect+, or +head+.
#
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_controller/metal/instrumentation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
require "abstract_controller/logger"

module ActionController
# = Action Controller \Instrumentation
#
# Adds instrumentation to several ends in ActionController::Base. It also provides
# some hooks related with process_action. This allows an ORM like Active Record
# and/or DataMapper to plug in ActionController and show related information.
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_controller/metal/live.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
require "active_support/json"

module ActionController
# = Action Controller \Live
#
# Mix this module into your controller, and all actions in that controller
# will be able to stream data to the client as it's written.
#
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_controller/metal/params_wrapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
require "action_dispatch/http/mime_type"

module ActionController
# = Action Controller Params Wrapper
#
# Wraps the parameters hash into a nested hash. This will allow clients to
# submit requests without having to specify any root elements.
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ class InvalidAuthenticityToken < ActionControllerError # :nodoc:
class InvalidCrossOriginRequest < ActionControllerError # :nodoc:
end

# = Action Controller Request Forgery Protection
#
# Controller actions are protected from Cross-Site Request Forgery (CSRF) attacks
# by including a token in the rendered HTML for your application. This token is
# stored as a random string in the session, to which an attacker does not have
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_controller/metal/rescue.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

module ActionController # :nodoc:
# = Action Controller \Rescue
#
# This module is responsible for providing +rescue_from+ helpers
# to controllers and configuring when detailed exceptions must be
# shown.
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_controller/metal/streaming.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
require "rack/chunked"

module ActionController # :nodoc:
# = Action Controller \Streaming
#
# Allows views to be streamed back to the client as they are rendered.
#
# By default, Rails renders views by first rendering the template
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_controller/metal/url_for.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

module ActionController
# = Action Controller \UrlFor
#
# Includes +url_for+ into the host class. The class has to provide a +RouteSet+ by implementing
# the <tt>_routes</tt> method. Otherwise, an exception will be raised.
#
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_controller/renderer.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

module ActionController
# = Action Controller \Renderer
#
# ActionController::Renderer allows you to render arbitrary templates without
# being inside a controller action.
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
require "active_support/core_ext/array/wrap"

module ActionDispatch # :nodoc:
# = Action Dispatch Content Security Policy
#
# Configures the HTTP
# {Content-Security-Policy}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy]
# response header to help protect against XSS and injection attacks.
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_dispatch/http/filter_parameters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

module ActionDispatch
module Http
# = Action Dispatch HTTP Filter Parameters
#
# Allows you to specify sensitive query string and POST parameters to filter
# from the request log.
#
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_dispatch/http/headers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

module ActionDispatch
module Http
# = Action Dispatch HTTP \Headers
#
# Provides access to the request's HTTP headers from the environment.
#
# env = { "CONTENT_TYPE" => "text/plain", "HTTP_USER_AGENT" => "curl/7.43.0" }
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_dispatch/http/permissions_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
require "active_support/core_ext/object/deep_dup"

module ActionDispatch # :nodoc:
# = Action Dispatch \PermissionsPolicy
#
# Configures the HTTP
# {Feature-Policy}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy]
# response header to specify which browser features the current document and
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_dispatch/http/response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
require "monitor"

module ActionDispatch # :nodoc:
# = Action Dispatch \Response
#
# Represents an HTTP response generated by a controller action. Use it to
# retrieve the current state of the response, or customize the response. It can
# either represent a real HTTP response (i.e. one that is meant to be sent
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_dispatch/http/upload.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

module ActionDispatch
module Http
# = Action Dispatch HTTP \UploadedFile
#
# Models uploaded files.
#
# The actual file is accessible via the +tempfile+ accessor, though some
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_dispatch/middleware/assume_ssl.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

module ActionDispatch
# = Action Dispatch \AssumeSSL
#
# When proxying through a load balancer that terminates SSL, the forwarded request will appear
# as though its HTTP instead of HTTPS to the application. This makes redirects and cookie
# security target HTTP instead of HTTPS. This middleware makes the server assume that the
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_dispatch/middleware/callbacks.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

module ActionDispatch
# = Action Dispatch \Callbacks
#
# Provides callbacks to be executed before and after dispatching the request.
class Callbacks
include ActiveSupport::Callbacks
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_dispatch/middleware/debug_exceptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
require "action_view"

module ActionDispatch
# = Action Dispatch \DebugExceptions
#
# This middleware is responsible for logging exceptions and
# showing a debugging page in case the request is local.
class DebugExceptions
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_dispatch/middleware/debug_locks.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

module ActionDispatch
# = Action Dispatch \DebugLocks
#
# This middleware can be used to diagnose deadlocks in the autoload interlock.
#
# To use it, insert it near the top of the middleware stack, using
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_dispatch/middleware/flash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
require "active_support/core_ext/hash/keys"

module ActionDispatch
# = Action Dispatch \Flash
#
# The flash provides a way to pass temporary primitive-types (String, Array, Hash) between actions. Anything you place in the flash will be exposed
# to the very next action and then cleared out. This is a great way of doing notices and alerts, such as a create
# action that sets <tt>flash[:notice] = "Post successfully created"</tt> before redirecting to a display action that can
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

module ActionDispatch
# = Action Dispatch \HostAuthorization
#
# This middleware guards from DNS rebinding attacks by explicitly permitting
# the hosts a request can be sent to, and is passed the options set in
# +config.host_authorization+.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

module ActionDispatch
# = ActionDispatch \PublicExceptions
#
# When called, this middleware renders an error page. By default if an HTML
# response is expected it will render static error pages from the <tt>/public</tt>
# directory. For example when this middleware receives a 500 response it will
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_dispatch/middleware/reloader.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

module ActionDispatch
# = Action Dispatch \Reloader
#
# ActionDispatch::Reloader wraps the request with callbacks provided by
# ActiveSupport::Reloader, intended to assist with code reloading during
# development.
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_dispatch/middleware/remote_ip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
require "ipaddr"

module ActionDispatch
# = Action Dispatch \RemoteIp
#
# This middleware calculates the IP address of the remote client that is
# making the request. It does this by checking various headers that could
# contain the address, and then picking the last-set address that is not
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_dispatch/middleware/request_id.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
require "active_support/core_ext/string/access"

module ActionDispatch
# = Action Dispatch \RequestId
#
# Makes a unique request id available to the +action_dispatch.request_id+ env variable (which is then accessible
# through ActionDispatch::Request#request_id or the alias ActionDispatch::Request#uuid) and sends
# the same id to the client via the +X-Request-Id+ header.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

module ActionDispatch
module Session
# = Action Dispatch Session \CacheStore
#
# A session store that uses an ActiveSupport::Cache::Store to store the sessions. This store is most useful
# if you don't store critical data in your sessions and you don't need them to live for extended periods
# of time.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

module ActionDispatch
module Session
# = ActionDispatch Session \CookieStore
#
# This cookie-based session store is the Rails default. It is
# dramatically faster than the alternatives.
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

module ActionDispatch
module Session
# = Action Dispatch Session \MemCacheStore
#
# A session store that uses MemCache to implement storage.
#
# ==== Options
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_dispatch/middleware/show_exceptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
require "action_dispatch/middleware/exception_wrapper"

module ActionDispatch
# = Action Dispatch \ShowExceptions
#
# This middleware rescues any exception returned by the application
# and calls an exceptions app that will wrap it in a format for the end user.
#
Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_dispatch/middleware/ssl.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

module ActionDispatch
# = Action Dispatch \SSL
#
# This middleware is added to the stack when <tt>config.force_ssl = true</tt>, and is passed
# the options set in +config.ssl_options+. It does three jobs to enforce secure HTTP
# requests:
Expand Down
4 changes: 4 additions & 0 deletions actionpack/lib/action_dispatch/middleware/static.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
require "rack/utils"

module ActionDispatch
# = Action Dispatch \Static
#
# This middleware serves static files from disk, if available.
# If no file is found, it hands off to the main app.
#
Expand All @@ -24,6 +26,8 @@ def call(env)
end
end

# = ActionDispatch \FileHandler
#
# This endpoint serves static files from disk using +Rack::Files+.
#
# URL paths are matched with static files according to expected
Expand Down