36 lines
782 B
C++
36 lines
782 B
C++
#ifndef ___image_h__
|
|
#define ___image_h__
|
|
|
|
#include "HTTPPage.h"
|
|
#include "File.h"
|
|
|
|
namespace http {
|
|
|
|
class _image : public HTTPPage {
|
|
|
|
bool test(coreutils::ZString &request) {
|
|
if(request.str() == "/image/") {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
int processCommand(HTTPRequest *httpRequest,
|
|
core::TCPSession *session,
|
|
HTTPSession *httpSession,
|
|
std::stringstream &out) override {
|
|
|
|
coreutils::File workspace("/home/barant/jetserver/images/barant_web_logo.png");
|
|
workspace.read();
|
|
httpRequest->response.addHeader("Content-Type", "image/png");
|
|
out << workspace.asString();
|
|
|
|
return 0;
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|