The goals are:
* To have better result in the GetCapabilities URL without having to fill it in the Project configuration
* Be able to be set by an integrator with environment variable or by providing headers from a proxy
The server resolution will use the following order:
- Value defined in the project per service.
- The ``<service>_SERVICE_URL`` environment variable.
- The ``SERVICE_URL`` environment variable.
- The custom ``X-Qgis-<service>-Servcie-Url`` header.
- The custom ``X-Qgis-Service-Url`` header.
- Build form the standard ``Forwarded`` header.
- Build form the pseudo standard ``X-Forwarded-Host`` and ``X-Forwarded-Proto`` headers.
- Build form the standard ``Host`` header and the server protocol.
- Build form the server name and the server protocol.
The change to the the feature filter group filterFeatures
(do not clear pre-existing filters) should not be a behavioral
change: additional filters are ANDed.
Defined a new QGIS Server setting environnement `QGIS_SERVER_DONT_LOAD_LAYOUTS` to do not load layouts when QGIS Server reads projects.
This variable will disable QGIS Server GetPrint capabilities.
Plus removed sql injection protection from
sanitize because:
1. it was not required: the value goes into a QgsExpression and it's
never sent to a provider directly
2. it could have been misused with the wrong assumption that
it was robust implementation (it wasn't)
Allow to override the default behavior in case of
bad layers (which is to invalidate the whole project).
When set to TRUE, the bad layers are skipped and the
project is considered available.
Followup #8922
QGIS Server throw an exception if the project has bad layers, but the user can defined restricted layers which are unpublished layers.
So restricted layers can be bad layers server side, it is not necessary an error.
This code verified that the bad layers are not restricted. If the project contains unrestricted bad layers, the server throw an exception.