Commit Graph
5 Commits
Author SHA1 Message Date
Brad ArantandClaude Sonnet 5 94d4a30e88 Fix CGI form/cookie data handling and CGI URL encode/decode
- CGIFormData: fix broken setSize()+read() double-length bug that
  corrupted every parsed body with a leading run of garbage bytes
  (setSize(contentLength) pre-set length before read()/write()
  appended on top of it); switch content-type checks from exact
  equality to startsWith() since a real multipart Content-Type
  always carries a boundary= parameter; implement the previously
  empty multipart/form-data branch (ordinary fields only, file
  uploads deferred to a separate upload mechanism per TODO.txt);
  restore operator[] real lookup logic (was hardcoded to echo the
  key back); default-initialize formdata to NULL; fix mismatched
  include guard (leftover from an IMFFormData.h copy-paste); drop
  the unused IMFHeader.h include that pulled in a broken,
  unrelated StreamReader.h dependency.
- CGIFormattedData: parameterize the split delimiter (was hardcoded
  to &, which silently broke cookie parsing since HTTP_COOKIE uses
  ; not &) and trim whitespace on each split token.
- MString::toCGI()/fromCGI(): were unimplemented stubs (always
  returned an empty string); implemented proper CGI percent-encode
  / percent-decode + space plus-encoding, and fixed the one caller
  that discarded fromCGIs return value instead of using it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-22 21:37:10 -07:00
Brad Arant 829dc1a3c7 Fixed MString and MFile. 2025-12-04 16:40:11 -08:00
Brad Arant 9cd8381845 significant work on cookies and cgi formdata variables. 2025-03-18 16:46:20 -07:00
brad Arant b774e50b59 more session work. 2025-03-17 07:45:02 -07:00
Brad Arant 25916051e6 added CGIFormattedData object. 2025-03-06 14:47:57 -08:00