CGI size
This commit is contained in:
@ -246,8 +246,12 @@ bool connection_handler(const char *preprefix, const char *col1, const char *col
|
|||||||
" REDIRECT_STATUS=" + cli_encode("CGI") +
|
" REDIRECT_STATUS=" + cli_encode("CGI") +
|
||||||
" DOCUMENT_ROOT=" + cli_encode(getWebRoot(host)) +
|
" DOCUMENT_ROOT=" + cli_encode(getWebRoot(host)) +
|
||||||
" " + req.cgiExport() +
|
" " + req.cgiExport() +
|
||||||
(req.isExistingField("Content-Length")?" CONTENT_LENGTH="+cli_encode(req.getField("Content-Length")):"") +
|
(req.isExistingField("Content-Length") ? " CONTENT_LENGTH=" +
|
||||||
(req.isExistingField("Content-Type")?" CONTENT_TYPE="+cli_encode(req.getField("Content-Type")):"") +
|
cli_encode(req.getField(
|
||||||
|
"Content-Length"))
|
||||||
|
: "") +
|
||||||
|
(req.isExistingField("Content-Type") ? " CONTENT_TYPE=" + cli_encode(
|
||||||
|
req.getField("Content-Type")) : "") +
|
||||||
((socket->isSecured()) ? " HTTPS=on" : "") +
|
((socket->isSecured()) ? " HTTPS=on" : "") +
|
||||||
" PATH_INFO=" + cli_encode(path.getFilePathInfo()) +
|
" PATH_INFO=" + cli_encode(path.getFilePathInfo()) +
|
||||||
" PATH_TRANSLATED=" + cli_encode(path.getAbsolutePath()) +
|
" PATH_TRANSLATED=" + cli_encode(path.getAbsolutePath()) +
|
||||||
@ -271,7 +275,9 @@ bool connection_handler(const char *preprefix, const char *col1, const char *col
|
|||||||
childpid = pipes.pid;
|
childpid = pipes.pid;
|
||||||
|
|
||||||
//if (req.getMethod() == "POST" || req.getMethod() == "PUT") {
|
//if (req.getMethod() == "POST" || req.getMethod() == "PUT") {
|
||||||
long len = req.isExistingField("Content-Length") ? strtol(req.getField("Content-Length").c_str(), nullptr, 10) : -1;
|
long len = req.isExistingField("Content-Length") ? strtol(
|
||||||
|
req.getField("Content-Length").c_str(), nullptr, 10) : (
|
||||||
|
req.getMethod() == "POST" || req.getMethod() == "PUT)?-1:0;
|
||||||
log(prefix, to_string(len));
|
log(prefix, to_string(len));
|
||||||
socket->receive(pipes.stdin, len);
|
socket->receive(pipes.stdin, len);
|
||||||
//}
|
//}
|
||||||
@ -317,7 +323,8 @@ bool connection_handler(const char *preprefix, const char *col1, const char *col
|
|||||||
|
|
||||||
bool compress = /*path.isStatic() &&*/ type.find("text/") == 0 &&
|
bool compress = /*path.isStatic() &&*/ type.find("text/") == 0 &&
|
||||||
req.isExistingField("Accept-Encoding") &&
|
req.isExistingField("Accept-Encoding") &&
|
||||||
req.getField("Accept-Encoding").find("deflate") != string::npos;
|
req.getField("Accept-Encoding").find(
|
||||||
|
"deflate") != string::npos;
|
||||||
|
|
||||||
if (compress) {
|
if (compress) {
|
||||||
req.setField("Accept-Ranges", "none");
|
req.setField("Accept-Ranges", "none");
|
||||||
|
Reference in New Issue
Block a user