Skip to content

Commit 39ecd25

Browse files
committed
fixup pre-commit complaints
1 parent 27cfb62 commit 39ecd25

2 files changed

Lines changed: 15 additions & 9 deletions

File tree

src/sagemaker_server.cc

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

src/sagemaker_server.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
// Copyright 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
//
33
// Redistribution and use in source and binary forms, with or without
44
// modification, are permitted provided that the following conditions

0 commit comments

Comments
 (0)