Updated and working.
This commit is contained in:
1 parent
d4148b0ab4
commit
a37c4e6829
30 files changed
+422
-226
No files matched your search
+7
-13
@@ -15,16 +15,18 @@ namespace coreutils {
|
||||
std::stringstream response;
|
||||
response << protocol << " " << code << " " << text << CRLF;
|
||||
|
||||
if(mode == LENGTH)
|
||||
addHeader((char *)"Content-Length", (char *)std::to_string(content.gcount()).c_str());
|
||||
if(mode == LENGTH) {
|
||||
sprintf(contentLength, "%li", content.str().length());
|
||||
ZString conlen(contentLength);
|
||||
addHeader("Content-Length", conlen);
|
||||
}
|
||||
else
|
||||
addHeader((char *)"Transfer-Encoding", (char *)"chunked");
|
||||
addHeader("Transfer-Encoding", "chunked");
|
||||
|
||||
addHeader((char *)"Server", (char *)"JETServer v0.0.1");
|
||||
addHeader("Server", "JETServer v0.0.1");
|
||||
|
||||
output(response);
|
||||
response << content.str();
|
||||
// core::Log(core::LOG_DEBUG_4) << response.str();
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -40,12 +42,4 @@ namespace coreutils {
|
||||
this->text = text;
|
||||
}
|
||||
|
||||
void IMFResponse::setCookie(ZString key, ZString data) {
|
||||
addHeader("Set-Cookie", data);
|
||||
}
|
||||
|
||||
void IMFResponse::setCookie(ZString key, std::string data) {
|
||||
addHeader("Set-Cookie", ZString(data.c_str()));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user