@@ -295,14 +295,17 @@ SagemakerAPIServer::ParseSageMakerRequest(
295295 }
296296
297297 std::filesystem::path url_path (url_string);
298- url_path = std::filesystem::absolute (url_path.lexically_normal ()); // Normalize the path to remove any redundant components.
298+ url_path = std::filesystem::absolute (
299+ url_path.lexically_normal ()); // Normalize the path to remove any
300+ // redundant components.
299301 auto repo_path = url_path.string ();
300302
301- if (repo_path.find (" /dev/" ) == 0 || repo_path.find (" /proc/" ) == 0
302- || repo_path.find (" /sys/" ) == 0 ) {
303+ if (repo_path.find (" /dev/" ) == 0 || repo_path.find (" /proc/" ) == 0 ||
304+ repo_path.find (" /sys/" ) == 0 ) {
303305 LOG_ERROR << " Invalid URL: " << url_string
304306 << " . \" url\" property value cannot start with /dev/, /proc/, or "
305- " /sys/." << std::endl;
307+ " /sys/."
308+ << std::endl;
306309 evhtp_send_reply (req, EVHTP_RES_BADREQ );
307310 return ;
308311 }
@@ -912,14 +915,17 @@ SagemakerAPIServer::SageMakerMMELoadModel(
912915 std::string target_model = parse_map.at (" target_model" );
913916
914917 std::filesystem::path url_path (url_string);
915- url_path = std::filesystem::absolute (url_path.lexically_normal ()); // Normalize the path to remove any redundant components.
918+ url_path = std::filesystem::absolute (
919+ url_path.lexically_normal ()); // Normalize the path to remove any
920+ // redundant components.
916921 std::string repo_path = url_path.string ();
917922
918- if (repo_path.find (" /dev/" ) == 0 || repo_path.find (" /proc/" ) == 0
919- || repo_path.find (" /sys/" ) == 0 ) {
923+ if (repo_path.find (" /dev/" ) == 0 || repo_path.find (" /proc/" ) == 0 ||
924+ repo_path.find (" /sys/" ) == 0 ) {
920925 LOG_ERROR << " Invalid repository path: " << url_string
921926 << " . \" url\" property of `parse_map`cannot start with /dev/, "
922- " /proc/, or /sys/." << std::endl;
927+ " /proc/, or /sys/."
928+ << std::endl;
923929 evhtp_send_reply (req, EVHTP_RES_BADREQ );
924930 return ;
925931 }
0 commit comments