File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3434#include "mapserver-config.h"
3535#include <stdbool.h>
3636#include <stdlib.h>
37+ #include <string.h>
3738
3839#ifdef USE_FASTCGI
3940#define NO_FCGI_DEFINES
@@ -341,8 +342,24 @@ int main(int argc, char *argv[]) {
341342 if (ms_index_dir != NULL ) {
342343 // Try normal dispatch first
343344 if (msCGIDispatchRequest (mapserv ) != MS_SUCCESS ) {
344- // Fallback to landing page
345- if (msCGIDispatchMapIndexRequest (mapserv , config ) != MS_SUCCESS ) {
345+ errorObj * ms_error = msGetErrorObj ();
346+ int show_index = MS_FALSE ;
347+ if (mapserv -> request -> NumParams == 0 ) {
348+ show_index = MS_TRUE ;
349+ } else if (ms_error != NULL && ms_error -> code == MS_WEBERR ) {
350+ if (strstr (ms_error -> message , "No query information to decode" ) !=
351+ NULL ||
352+ strstr (ms_error -> message ,
353+ "Traditional BROWSE mode requires a TEMPLATE" ) !=
354+ NULL ) {
355+ // Fallback to landing page
356+ show_index = MS_TRUE ;
357+ }
358+ }
359+
360+ if (show_index &&
361+ msCGIDispatchMapIndexRequest (mapserv , config ) == MS_SUCCESS ) {
362+ } else {
346363 msCGIWriteError (mapserv );
347364 goto end_request ;
348365 }
You can’t perform that action at this time.
0 commit comments