|
@@ -2158,7 +2158,12 @@ namespace robotics::v3 {
|
|
|
}
|
|
|
void fill_file(std::filesystem::path const& path, http::status status = http::status::ok) {
|
|
|
auto& response = http_context::current()->response;
|
|
|
- response.fill_file(path, status);
|
|
|
+ if (path.c_str()[0] == '/' || path.c_str()[0] == '\\') {
|
|
|
+ response.fill_file(path, status);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ response.fill_file("/" + path.string(), status);
|
|
|
+ }
|
|
|
}
|
|
|
void fill_html(std::string const& html, http::status status = http::status::ok) {
|
|
|
auto& response = http_context::current()->response;
|
|
@@ -2198,7 +2203,7 @@ namespace robotics::v3 {
|
|
|
fill_file(get_filename(), status);
|
|
|
}
|
|
|
std::filesystem::path get_filename() {
|
|
|
- return "/" + mvc::http_context::current()->get_controller_action()->file_mapping;
|
|
|
+ return mvc::http_context::current()->get_controller_action()->file_mapping;
|
|
|
}
|
|
|
};
|
|
|
|