From d0f2551e8962f96468590552f4fcbd343a09c2e1 Mon Sep 17 00:00:00 2001 From: Brad Arant Date: Wed, 10 Dec 2025 16:48:23 -0800 Subject: [PATCH] Still working out cgi variable stuff. --- Tag.cpp | 13 ++++++++----- __jet.cpp | 3 ++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Tag.cpp b/Tag.cpp index b63136d..45d0315 100644 --- a/Tag.cpp +++ b/Tag.cpp @@ -407,11 +407,14 @@ namespace jet { else return parent->keywords[name]; } else if(variable.ifNext(":")) { - renderVariableName(variable, name, modifier); - if(name.find(":") == -1) { - name << ":0"; - } - return processModifier(global.cgiData[name], modifier); + if(global.cgi) { + renderVariableName(variable, name, modifier); + if(name.find(":") == -1) { + name << ":0"; + } + return processModifier(global.cgiData[name], modifier); + } else + throw coreutils::Exception("cgi variable only allowed in cgi mode."); } else if(variable.ifNext("@")) { // TODO: should only allow session variables. Allow substitution. } else if(variable.ifNext("%")) { diff --git a/__jet.cpp b/__jet.cpp index 2f1f665..066e51f 100644 --- a/__jet.cpp +++ b/__jet.cpp @@ -35,8 +35,9 @@ namespace jet { if(requestMethod == "POST") { coreutils::ZString contentLength(getenv("CONTENT_LENGTH")); coreutils::ZString contentType(getenv("CONTENT_TYPE")); + ZString boundary = "xxxx"; - global.cgiData = new coreutils::CGIFormData(0, contentType, contentLength, boundary); + global.cgiData = new coreutils::CGIFormData(0, contentType, contentLength.asInteger(), boundary); } } processContainer(container, NULL, true);