code wiki / (root) / nx_http_form.nx

nx_http_form.nx

buildroot/runtime/nx_http_form.nx

9478 B261 linesdepth 0pulls 0 transitivereach 34 importersview sourcekind librarytopic http
docsdependenciesstructsconstsfunctions

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

nx_http_form.nx nx_ad_banner_builder.nx nx_adnet_submit.nx nx_bills_entry.nx nx_cms_admin.nx nx_gallery_gateway.nx nx_gen_gateway.nx nx_http_form_test.nx nx_intake_handler.nx nx_lan_signup_routes.nx nx_mesh_gateway.nx

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

36const NXF_OK: i64 = 0
37const NXF_OOM_BUFFER: i64 = 1
38const NXF_BAD_PCT: i64 = 2
39const NXF_NOT_FOUND: i64 = 3
40const NXF_BAD_ARG: i64 = 4
41const NXF_VERDICT_N: i64 = 5

functions

43func nxf_verdict_is_valid(v: i64) -> i64
called by 1: main
49func nxf_verdict_name(v: i64) -> *u8
called by 1: main
62func nxf_hex_nibble(c: i64) -> i64
77func nxf_decode_chunk(
139func nx_http_form_get_field(
248func nx_http_form_count_pairs(body: *u8, body_n: i64) -> i64
called by 1: main