Mercurial > hg > orthanc
comparison Core/HttpServer/FilesystemHttpHandler.cpp @ 1911:7a05144cb919
fix issue #11
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 28 Jan 2016 17:07:22 +0100 |
parents | b1291df2f780 |
children | aa4b8895cd23 |
comparison
equal
deleted
inserted
replaced
1910:c32a8fab4fc4 | 1911:7a05144cb919 |
---|---|
93 #else | 93 #else |
94 std::string f = it->path().filename(); | 94 std::string f = it->path().filename(); |
95 #endif | 95 #endif |
96 | 96 |
97 std::string h = Toolbox::FlattenUri(uri) + "/" + f; | 97 std::string h = Toolbox::FlattenUri(uri) + "/" + f; |
98 if (fs::is_regular_file(it->status())) | 98 if (Toolbox::IsRegularFile(it->path().string())) |
99 { | |
99 s += "<li><a href=\"" + h + "\">" + f + "</a></li>"; | 100 s += "<li><a href=\"" + h + "\">" + f + "</a></li>"; |
101 } | |
100 } | 102 } |
101 | 103 |
102 s += " </ul>"; | 104 s += " </ul>"; |
103 s += " </body>"; | 105 s += " </body>"; |
104 s += "</html>"; | 106 s += "</html>"; |
154 for (size_t i = pimpl_->baseUri_.size(); i < uri.size(); i++) | 156 for (size_t i = pimpl_->baseUri_.size(); i < uri.size(); i++) |
155 { | 157 { |
156 p /= uri[i]; | 158 p /= uri[i]; |
157 } | 159 } |
158 | 160 |
159 if (fs::exists(p) && fs::is_regular_file(p)) | 161 if (Toolbox::IsRegularFile(p.string())) |
160 { | 162 { |
161 FilesystemHttpSender sender(p); | 163 FilesystemHttpSender sender(p); |
162 output.Answer(sender); // TODO COMPRESSION | 164 output.Answer(sender); // TODO COMPRESSION |
163 } | 165 } |
164 else if (listDirectoryContent_ && | 166 else if (listDirectoryContent_ && |