Skip to content

Commit

Permalink
Document MS_WMS_ERROR_STATUS_CODE
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Dec 9, 2024
1 parent 767c4bc commit c6ea47c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions en/mapfile/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ A full sample config file is shown below:
# MS_OPENLAYERS_JS_URL "http://openlayers.org/api/OpenLayers.js"
# MS_TEMPPATH "/tmp"
# MS_MAX_OPEN_FILES 200 # maximum number of open files allowed on Windows
# MS_WMS_ERROR_STATUS_CODE "ON" # enable HTTP status code 4xx and 5xx in case of errors on WMS requests
END

#
Expand Down
31 changes: 31 additions & 0 deletions en/ogc/wms_server.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2165,6 +2165,37 @@ Vendor specific WMS parameters
.. index::
pair: WMS; Cascading requests

HTTP status error codes
-----------------------

The OGC WMS specification is not explicit about which HTTP status error code
servers should return in case of errors. Traditionaly most WMS implementation
return "200 OK" in those situations. Starting with MapServer 8.4, it is
possible to define the ``MS_WMS_ERROR_STATUS_CODE`` configuration option to ``ON``
in the CONFIG.ENV section of the MapServer configuration file to ask MapServer
to return HTTP 4xx or 5xx status codes in case of error.


.. code-block:: mapfile


CONFIG
#
# Environment variables
#
ENV
#
# Limit Mapfile Access
#
# MS_MAP_NO_PATH "1"
MS_MAP_PATTERN "^/opt/mapserver" ## required when referencing mapfiles by path
# MS_MAP_BAD_PATTERN "[/\\]{2}|[/\\]?\\.+[/\\]|,"

# Enable HTTP status code 4xx and 5xx in case of errors on WMS requests
MS_WMS_ERROR_STATUS_CODE "ON"
END
END

Cascading WMS Requests
----------------------

Expand Down

0 comments on commit c6ea47c

Please sign in to comment.