]> Lady’s Gitweb - CGirls/commit
Add request parsing and related tests
authorLady <redacted>
Tue, 18 Mar 2025 04:31:32 +0000 (00:31 -0400)
committerLady <redacted>
Thu, 20 Mar 2025 04:22:22 +0000 (00:22 -0400)
commitf6f2fd79a596ecedaadd8b605b7de9d8c662151c
treef07e6103e600d0da2d7be2d88b1f16ef6a441d1d
parent091679702255610d868b06af26ffa0ba5a6bf6d7
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.
24 files changed:
cgirls-test-pathinfo.c [new file with mode: 0644]
expect/pathinfo/01-emptyproj [new file with mode: 0644]
expect/pathinfo/02-blush [new file with mode: 0644]
expect/pathinfo/03-noverb [new file with mode: 0644]
expect/pathinfo/04-badverbwext [new file with mode: 0644]
expect/pathinfo/05-noverbokext [new file with mode: 0644]
expect/pathinfo/06-dotid [new file with mode: 0644]
expect/pathinfo/07-nobase [new file with mode: 0644]
expect/pathinfo/08-notarget [new file with mode: 0644]
expect/pathinfo/09-canonical [new file with mode: 0644]
expect/pathinfo/10-blushypath [new file with mode: 0644]
request.c [new file with mode: 0644]
request.h [new file with mode: 0644]
sh/test.sh
test/pathinfo/01-emptyproj [new file with mode: 0644]
test/pathinfo/02-blush [new file with mode: 0644]
test/pathinfo/03-noverb [new file with mode: 0644]
test/pathinfo/04-badverbwext [new file with mode: 0644]
test/pathinfo/05-noverbokext [new file with mode: 0644]
test/pathinfo/06-dotid [new file with mode: 0644]
test/pathinfo/07-nobase [new file with mode: 0644]
test/pathinfo/08-notarget [new file with mode: 0644]
test/pathinfo/09-canonical [new file with mode: 0644]
test/pathinfo/10-blushypath [new file with mode: 0644]
This page took 0.057816 seconds and 4 git commands to generate.