moe testing work.

This commit is contained in:
brad Arant 2025-03-09 14:58:22 -07:00
parent 80d31540d9
commit d74093b48a
2 changed files with 8 additions and 7 deletions

View File

@ -46,11 +46,12 @@ namespace jet {
coreutils::ZString contentLength(getenv("CONTENT_LENGTH")); coreutils::ZString contentLength(getenv("CONTENT_LENGTH"));
coreutils::ZString contentType(getenv("CONTENT_TYPE")); coreutils::ZString contentType(getenv("CONTENT_TYPE"));
coreutils::MString postdata; if(contentType == "multipart/form-data") {
postdata.read(0); // TODO: Need to limit the read characters to the CONTENT-LENGTH value; coreutils::IMFMultipart postdata(0, contentLength.asInteger());
}
if(contentType == "multipart/form-data")
global.setupFormData(postdata);
else if(contentType == "application/x-www-form-urlencoded") else if(contentType == "application/x-www-form-urlencoded")
global.setupFormURLEncoded(postdata); global.setupFormURLEncoded(postdata);
} }

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
export REQUEST_METHOD=POST export REQUEST_METHOD=POST
export CONTENT_LENGTH=200 export CONTENT_LENGTH=619
export CONTENT_TYPE=application/x-www-form-urlencoded export CONTENT_TYPE=multipart/form-data
cat post.example.urlencoded | ./testpost.jet cat post.example.formdata | ./testpost.jet