From d74093b48a0ce38ce782fe240d6ccb0804157d68 Mon Sep 17 00:00:00 2001 From: brad Arant Date: Sun, 9 Mar 2025 14:58:22 -0700 Subject: [PATCH] moe testing work. --- __jet.cpp | 9 +++++---- tests/posttest.sh | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/__jet.cpp b/__jet.cpp index b8bf136..d9b8fe0 100644 --- a/__jet.cpp +++ b/__jet.cpp @@ -46,11 +46,12 @@ namespace jet { coreutils::ZString contentLength(getenv("CONTENT_LENGTH")); coreutils::ZString contentType(getenv("CONTENT_TYPE")); - coreutils::MString postdata; - postdata.read(0); // TODO: Need to limit the read characters to the CONTENT-LENGTH value; + if(contentType == "multipart/form-data") { + coreutils::IMFMultipart postdata(0, contentLength.asInteger()); + + } + - if(contentType == "multipart/form-data") - global.setupFormData(postdata); else if(contentType == "application/x-www-form-urlencoded") global.setupFormURLEncoded(postdata); } diff --git a/tests/posttest.sh b/tests/posttest.sh index 83fc1ef..f212bcc 100755 --- a/tests/posttest.sh +++ b/tests/posttest.sh @@ -1,5 +1,5 @@ #!/bin/bash export REQUEST_METHOD=POST -export CONTENT_LENGTH=200 -export CONTENT_TYPE=application/x-www-form-urlencoded -cat post.example.urlencoded | ./testpost.jet +export CONTENT_LENGTH=619 +export CONTENT_TYPE=multipart/form-data +cat post.example.formdata | ./testpost.jet