significant work on cookies and cgi formdata variables.
This commit is contained in:
parent
050b5f2b87
commit
078ba7f81c
12
__jet.cpp
12
__jet.cpp
@ -9,13 +9,10 @@ namespace jet {
|
||||
|
||||
__jet::__jet(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : Tag(in, parentOut, global, parent, this) {
|
||||
char *cookies;
|
||||
std::cout << "010" << std::endl;
|
||||
if(keywordDefined("cgi") && (resolveKeyword("cgi") == "true")) {
|
||||
std::cout << "011" << std::endl;
|
||||
global.cgi = true;
|
||||
|
||||
if(keywordDefined("sessiondir")) {
|
||||
std::cout << "012" << std::endl;
|
||||
global.cookies = getenv("HTTP_COOKIE");
|
||||
global.session = true;
|
||||
// if request_has_cookie then
|
||||
@ -43,19 +40,14 @@ namespace jet {
|
||||
|
||||
}
|
||||
|
||||
std::cout << "013" << std::endl;
|
||||
coreutils::ZString requestMethod(getenv("REQUEST_METHOD"));
|
||||
if(requestMethod == "POST") {
|
||||
std::cout << "014: " << requestMethod << std::endl;
|
||||
coreutils::ZString contentLength(getenv("CONTENT_LENGTH"));
|
||||
coreutils::ZString contentType(getenv("CONTENT_TYPE"));
|
||||
|
||||
if(contentType == "multipart/form-data") {
|
||||
std::cout << "015" << std::endl;
|
||||
coreutils::IMFMultipart postdata(0, contentLength.asInteger());
|
||||
std::cout << "016" << std::endl;
|
||||
if(contentType == "multipart/form-data")
|
||||
coreutils::IMFMultipart postdata(0, "");
|
||||
|
||||
}
|
||||
// else if(contentType == "application/x-www-form-urlencoded")
|
||||
// global.setupFormURLEncoded(postdata);
|
||||
}
|
||||
|
@ -1,5 +1,11 @@
|
||||
*** CGI VARIABLES ***
|
||||
*** GLOBAL VARIABLES ***
|
||||
*** LOCAL VARIABLES ***
|
||||
*** KEYWORD VALUES ***
|
||||
cgi=[true]
|
||||
sessiondir=[.]
|
||||
*** COOKIES ***
|
||||
|
||||
$[^session]
|
||||
<dump file="./d=[]
|
||||
session=[18fd56a83f]
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!../jet-2.0
|
||||
<upload name="imagefiledata" path="images/%name" />
|
||||
<jet cgi="true" sessiondir=".">
|
||||
|
||||
$[^session]
|
||||
<dump file="./dump.txt" />
|
||||
</jet>
|
||||
|
Loading…
x
Reference in New Issue
Block a user