From: Lady Date: Tue, 18 Mar 2025 04:31:32 +0000 (-0400) Subject: Add request parsing and related tests X-Git-Url: https://git.ladys.computer/CGirls/commitdiff_plain/f6f2fd79a596ecedaadd8b605b7de9d8c662151c?hp=f6f2fd79a596ecedaadd8b605b7de9d8c662151c Add request parsing and related tests This commit adds a function for processing a “path info” string, for example one received through C·G·I (as the `PATH_INFO´ environment variable), into a structure which represents its semantics, `cgirls_req´. It also adds a function for reserializing this structure into a canonical form. The program `cgirls-test-pathinfo´ is used with the existing test infrastructure to ensure that strings are processed correctly. There is a flaw in this design (which I realized after making the original commit, but before writing this updated message), in that an empty identifier string is represented as `..´, which in a URL already has a different, and very normative, meaning of “parent directory”. This flaw will need to be fixed in a later commit. Probably some more tests could be added here; in particular only a few verbs and extensions are being tested right now and ideally they all would be. ---