@@ -973,18 +973,16 @@ static void init_request_info(void)
973973
974974 /* initialize the defaults */
975975 SG (request_info ).path_translated = NULL ;
976- SG (request_info ).request_method = NULL ;
976+ SG (request_info ).request_method = FCGI_GETENV ( request , "REQUEST_METHOD" ) ;
977977 SG (request_info ).proto_num = 1000 ;
978978 SG (request_info ).query_string = NULL ;
979979 SG (request_info ).request_uri = NULL ;
980980 SG (request_info ).content_type = NULL ;
981981 SG (request_info ).content_length = 0 ;
982982 SG (sapi_headers ).http_response_code = 200 ;
983983
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. */
988986 if (script_path_translated ) {
989987 const char * auth ;
990988 char * content_length = FCGI_GETENV (request , "CONTENT_LENGTH" );
@@ -1314,7 +1312,6 @@ static void init_request_info(void)
13141312 SG (request_info ).path_translated = estrdup (script_path_translated );
13151313 }
13161314
1317- SG (request_info ).request_method = FCGI_GETENV (request , "REQUEST_METHOD" );
13181315 /* FIXME - Work out proto_num here */
13191316 SG (request_info ).query_string = FCGI_GETENV (request , "QUERY_STRING" );
13201317 SG (request_info ).content_type = (content_type ? content_type : "" );
0 commit comments