nx_http_form.nx
buildroot/runtime/nx_http_form.nx
about
nx_http_form.nx -- application/x-www-form-urlencoded body parser.
HTTP form submission per WHATWG URL §5 + RFC 1866 §8.2.1:
key1=value1&key2=value2&key3=value3
Where:
- `+` decodes to space
- `%HH` decodes to a single byte (HH = uppercase or lowercase hex)
- Other bytes pass through
- Keys + values may be empty
- Final `&` is tolerated
Per cardinal feedback-no-third-party-trust-native-or-nothing:
substrate's own parser; no querystring lib, no urlencoded-body
middleware. ~250 LOC; auditable.
Per cardinal feedback-privacy-by-default-no-tracking:
substrate doesn't store the parsed form data anywhere; caller
supplies output buffers + decides retention.
nx_capability_claims:
needs: [sealed_enum, byte_ops]
provides: [form_urlencoded_decode, named_field_extract,
pct_hex_decode, plus_to_space]
safety: [no_unchecked_deref, no_floating_point, no_syscall,
bounded_iteration, bit_equal_reproducible,
malformed_input_rejected]
verdict: [sealed_enum_5_state]
license: ORIGINAL
kind: racing_crew_specialist
layer: L2 (transform: bytes -> decoded key=value pairs)
dependencies 0 imports · 15 importers
diagram shows first 10 each side; +0 more imports, +5 more importers in the complete lists below.
imports: none
imported by: nx_ad_banner_builder.nxnx_adnet_submit.nxnx_bills_entry.nxnx_cms_admin.nxnx_gallery_gateway.nxnx_gen_gateway.nxnx_http_form_test.nxnx_intake_handler.nxnx_lan_signup_routes.nxnx_mesh_gateway.nxnx_opaque_login_daemon.nxnx_opaque_login_routes.nxnx_site_intake.nxnx_studio_gate.nxnx_vault_gateway.nx
structs
| none |
consts
| 36 | const NXF_OK: i64 = 0 |
| 37 | const NXF_OOM_BUFFER: i64 = 1 |
| 38 | const NXF_BAD_PCT: i64 = 2 |
| 39 | const NXF_NOT_FOUND: i64 = 3 |
| 40 | const NXF_BAD_ARG: i64 = 4 |
| 41 | const NXF_VERDICT_N: i64 = 5 |
functions
| 43 | func nxf_verdict_is_valid(v: i64) -> i64 called by 1: main |
| 49 | func nxf_verdict_name(v: i64) -> *u8 called by 1: main |
| 62 | func nxf_hex_nibble(c: i64) -> i64 |
| 77 | func nxf_decode_chunk( |
| 139 | func nx_http_form_get_field( |
| 248 | func nx_http_form_count_pairs(body: *u8, body_n: i64) -> i64 called by 1: main |