diff options
Diffstat (limited to 'rotord/rotord.cpp')
| -rwxr-xr-x | rotord/rotord.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/rotord/rotord.cpp b/rotord/rotord.cpp index a919a0b..1a68638 100755 --- a/rotord/rotord.cpp +++ b/rotord/rotord.cpp @@ -169,23 +169,23 @@ HTTPRequestHandler* RotorRequestHandlerFactory::createRequestHandler(const HTTPS //eventually retrieve from sql; //a bit of weirdness here: prefer to just get whole file to a string. if (request.getMethod()=="GET") { - std::vector<std::string> styles = {"style01.xml","style02.xml" }; //c++11 STL initialiser list - content+="<styles>\n"; - for (auto &style: styles) { - Poco::File f=Poco::File(style); + std::string stylesfile = "styles.xml"; + Poco::File f=Poco::File(stylesfile); if (f.exists()) { - Poco::FileInputStream file(style); - string s=""; - while (!file.eof()) { - content +=s; - file >> s; - content +=" "; - } - content +="\n"; + Poco::FileInputStream file(stylesfile); + //while (!file.eof()) { + // file >> content; + //} + Poco::StreamCopier::copyToString(file, content); + status=HTTPResponse::HTTP_OK; } - } - content+="</styles>\n"; - status=HTTPResponse::HTTP_OK; + else { + content="<status>Rotor: internal error: styles not found</status>\n"; + } + + } + else { + content="<status>Rotor: bad request</status>\n"; } } else { |
