Expand description
Structs§
- Http
Request - Owned HTTP request data used by the runtime after parsing and body capture.
- Parsed
Http Request - Minimal parsed request head returned by
parse_http_request.
Constants§
- PHAROS_
HTTP_ MAX_ BODY_ BYTES - Maximum accepted size of a non-multipart request body.
- PHAROS_
HTTP_ MAX_ HEADER_ BYTES - Maximum accepted size of the full HTTP request head.
- PHAROS_
HTTP_ MAX_ HEADER_ LINE_ BYTES - Maximum accepted size of any single HTTP header line.
- PHAROS_
HTTP_ MAX_ MULTIPART_ BODY_ BYTES - Maximum accepted size of a multipart request body.
- PHAROS_
HTTP_ MAX_ REQUEST_ LINE_ BYTES - Maximum accepted size of the request line.
Functions§
- access_
timestamp - Returns a stable UTC-like access timestamp in seconds.
- apply_
known_ header - Applies the bounded set of request headers consumed by the runtime.
- close_
logged_ file - Closes an optional log file explicitly.
- compact_
log_ text - Compacts one log line while preserving bounded UTF-8 text.
- connection_
printf - Appends a formatted text fragment to a bounded connection response buffer.
- contains_
chunked_ transfer - Returns whether a
Transfer-Encodingheader includeschunked. - content_
length_ 🔒value - Parses the content length value.
- extract_
forwarded_ ip - Returns the first forwarded client address when it is a valid IP literal.
- extract_
ip_ from_ peer_ info - Extracts an address from peer information without trusting arbitrary text.
- extract_
real_ ip_ from_ headers - Selects the real client IP from trusted forwarded headers or peer data.
- free_
http_ request - Releases owned request buffers and removes any temporary body file.
- http_
status_ code_ from_ response - Extracts a response status code from an HTTP status line.
- http_
status_ line_ from_ response - Returns the complete first status line from an HTTP response.
- http_
status_ text - Returns the canonical status line text used by the runtime for a bounded set of statuses.
- is_
sensitive_ 🔒header_ name - Returns whether sensitive header name.
- is_
trusted_ proxy - Checks whether a direct peer address belongs to one of the configured CIDRs.
- log_
level_ matches - Compares two configured log levels without accepting empty values.
- mime_
type_ for_ path - Returns the MIME type permitted for a static artifact path.
- parse_
content_ length_ header - Parses a decimal
Content-Lengthheader using the runtime’s non-negative bounds. - parse_
http_ request - Parses a bounded HTTP request head without accepting folded or malformed headers.
- parse_
ip_ to_ uint32 - Parses an IPv4 address into its network-order integer representation.
- request_
headers_ with_ client_ ip - Returns request headers with a validated client-address line appended.
- request_
path_ without_ query - Removes query and fragment data from a request target.
- request_
real_ ip - Returns a client address selected from the request’s trusted proxy context.
- resolved_
error_ report_ path - Resolves the configured error report path, restricting relative paths to the app root.
- send_
text_ response - Builds a text response wire representation with a bounded body.
- sensitive_
headers_ mask - Performs sensitive headers mask.
- sensitive_
headers_ redact - Redacts sensitive request headers before they enter an access log.
- win_
gettimeofday - Returns the current wall-clock time in microseconds since the Unix epoch.
- write_
error_ report - Writes one structured error report as an append-only JSONL record.
- write_
temp_ body_ chunk - Writes one bounded body chunk, retrying short writes without invoking external code.