@@ -924,29 +924,20 @@ static void http_ui_handler_shutdown(void)
924924 ui_uri = "/index.html" ;
925925 }
926926
927- if (ui_uri [0 ] != '/' ) {
928- goto error_404 ;
929- }
930-
931927 if (0 == http_ui_handler_data (SPX_G (data_dir ), ui_uri )) {
932928 goto finish ;
933929 }
934930
935- char local_file_absolute_path [PATH_MAX ];
936-
937- if (
938- spx_utils_resolve_confined_file_absolute_path (
939- SPX_G (http_ui_assets_dir ),
940- ui_uri ,
941- NULL ,
942- local_file_absolute_path ,
943- sizeof (local_file_absolute_path )
944- ) == NULL
945- ) {
946- goto error_404 ;
947- }
931+ char local_file_name [512 ];
932+ snprintf (
933+ local_file_name ,
934+ sizeof (local_file_name ),
935+ "%s%s" ,
936+ SPX_G (http_ui_assets_dir ),
937+ ui_uri
938+ );
948939
949- if (0 == http_ui_handler_output_file (local_file_absolute_path )) {
940+ if (0 == http_ui_handler_output_file (local_file_name )) {
950941 goto finish ;
951942 }
952943
@@ -1034,34 +1025,26 @@ static int http_ui_handler_data(const char * data_dir, const char *relative_path
10341025
10351026 const char * get_report_metadata_uri = "/data/reports/metadata/" ;
10361027 if (spx_utils_str_starts_with (relative_path , get_report_metadata_uri )) {
1037- char file_name [PATH_MAX ];
1038- if (
1039- spx_reporter_full_build_metadata_file_name (
1040- data_dir ,
1041- relative_path + strlen (get_report_metadata_uri ) - 1 ,
1042- file_name ,
1043- sizeof (file_name )
1044- ) == NULL
1045- ) {
1046- return -1 ;
1047- }
1028+ char file_name [512 ];
1029+ spx_reporter_full_build_metadata_file_name (
1030+ data_dir ,
1031+ relative_path + strlen (get_report_metadata_uri ),
1032+ file_name ,
1033+ sizeof (file_name )
1034+ );
10481035
10491036 return http_ui_handler_output_file (file_name );
10501037 }
10511038
10521039 const char * get_report_uri = "/data/reports/get/" ;
10531040 if (spx_utils_str_starts_with (relative_path , get_report_uri )) {
1054- char file_name [PATH_MAX ];
1055- if (
1056- spx_reporter_full_build_file_name (
1057- data_dir ,
1058- relative_path + strlen (get_report_uri ) - 1 ,
1059- file_name ,
1060- sizeof (file_name )
1061- ) == NULL
1062- ) {
1063- return -1 ;
1064- }
1041+ char file_name [512 ];
1042+ spx_reporter_full_build_file_name (
1043+ data_dir ,
1044+ relative_path + strlen (get_report_uri ),
1045+ file_name ,
1046+ sizeof (file_name )
1047+ );
10651048
10661049 return http_ui_handler_output_file (file_name );
10671050 }
0 commit comments