Skip to content

Commit

Permalink
Add docs for WSGIMapHEADToGET directive.
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamDumpleton committed Sep 13, 2024
1 parent 3d7a321 commit d49ed1b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/configuration-directives/WSGIMapHEADToGET.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
==================
WSGIMapHEADToGET
==================

:Description: Enable/disable mapping of HEAD request to GET.
:Syntax: ``WSGIMapHEADToGET On|Off|Auto``
:Default: ``WSGIMapHEADToGET Auto``
:Context: server config, virtual host, directory, .htaccess

The ``WSGIMapHEADToGET`` directive controls the behaviour of automatically
mapping any ``HEAD`` request to a ``GET`` request when an Apache output filter
is registered that may want to see the complete response in order to generate
correct response headers.

The directive can be set to be either ``Auto`` (the default), ``On`` which
will always map a ``HEAD`` to ``GET`` even if no output filters detected and
``Off`` to always preserve the original request method type.

The directive may be required where a WSGI application tries to optimize and
avoid doing work for a ``HEAD`` request by not actually generating a response
so that complete response headers can still be generated. By doing this the
WSGI application can break Apache filters for caching, so the mapping of
``HEAD`` to ``GET`` can be required to avoid problems.
1 change: 1 addition & 0 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Configuration
configuration-directives/WSGIDestroyInterpreter
configuration-directives/WSGIImportScript
configuration-directives/WSGILazyInitialization
configuration-directives/WSGIMapHEADToGET
configuration-directives/WSGIPassAuthorization
configuration-directives/WSGIProcessGroup
configuration-directives/WSGIPythonEggs
Expand Down

0 comments on commit d49ed1b

Please sign in to comment.