Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check SCRIPT_URI env-var for ows_onlineresource.
Apache HTTPD's mod_rewrite sets the SCRIPT_URI environment variable which contains the "logical" URI used to access the resource while the standard CGI parameter SCRIPT_NAME (and SERVER_NAME, SERVER_PORT) contain the "physical" path to the resource. When using MapServer as a WxS server it currently defaults ows_onlineresource parameter to: http[s]://SERVER_NAME:SERVER_PORT/SCRIPT_NAME?[map=...] This is less than ideal when using a rewrite rule to hide the path of the mapserver binary and present the illusion to the users that the mapfile is the URI endpoint (much like how .pl or .php files are usually presented.) This allows access to be controlled to each mapfile to be controlled using standard Apache configuration. E.g.: RewriteRule ^/datasets/(.*\.map) /cgi-bin/mapserv [PT,env=MS_MAPFILE:/srv/datasets/$1] However, in this case SCRIPT_URI contains the correct (i.e. what the client sees) base URI. So, ows_onlineresource should default to: SCRIPT_URI?[map=...] This patch implements this if the SCRIPT_URI environment variable is present. Otherwise, the behavior is the same as before.
- Loading branch information