significant work on cookies and cgi formdata variables.

This commit is contained in:
Brad Arant 2025-03-18 16:46:39 -07:00
parent 050b5f2b87
commit 078ba7f81c
3 changed files with 10 additions and 12 deletions

View File

@ -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);
}

View File

@ -1,5 +1,11 @@
*** CGI VARIABLES ***
*** GLOBAL VARIABLES ***
*** LOCAL VARIABLES ***
*** KEYWORD VALUES ***
cgi=[true]
sessiondir=[.]
*** COOKIES ***
$[^session]
<dump file="./d=[]
session=[18fd56a83f]

View File

@ -1,6 +1,6 @@
#!../jet-2.0
<upload name="imagefiledata" path="images/%name" />
<jet cgi="true" sessiondir=".">
$[^session]
<dump file="./dump.txt" />
</jet>