@@ -973,18 +973,16 @@ static void init_request_info(void)
973
973
974
974
/* initialize the defaults */
975
975
SG (request_info ).path_translated = NULL ;
976
- SG (request_info ).request_method = NULL ;
976
+ SG (request_info ).request_method = FCGI_GETENV ( request , "REQUEST_METHOD" ) ;
977
977
SG (request_info ).proto_num = 1000 ;
978
978
SG (request_info ).query_string = NULL ;
979
979
SG (request_info ).request_uri = NULL ;
980
980
SG (request_info ).content_type = NULL ;
981
981
SG (request_info ).content_length = 0 ;
982
982
SG (sapi_headers ).http_response_code = 200 ;
983
983
984
- /* script_path_translated being set is a good indication that
985
- * we are running in a cgi environment, since it is always
986
- * null otherwise. otherwise, the filename
987
- * of the script will be retrieved later via argc/argv */
984
+ /* if script_path_translated is not set, then there is no point to carry on
985
+ * as the response is 404 and there is no further processing. */
988
986
if (script_path_translated ) {
989
987
const char * auth ;
990
988
char * content_length = FCGI_GETENV (request , "CONTENT_LENGTH" );
@@ -1314,7 +1312,6 @@ static void init_request_info(void)
1314
1312
SG (request_info ).path_translated = estrdup (script_path_translated );
1315
1313
}
1316
1314
1317
- SG (request_info ).request_method = FCGI_GETENV (request , "REQUEST_METHOD" );
1318
1315
/* FIXME - Work out proto_num here */
1319
1316
SG (request_info ).query_string = FCGI_GETENV (request , "QUERY_STRING" );
1320
1317
SG (request_info ).content_type = (content_type ? content_type : "" );
0 commit comments