|
Pharos 0.7.23
Modern Web Framework & Web App Hosting Service.
|
Request field extraction helpers for in-process dynamic handling. More...
#include <stddef.h>Go to the source code of this file.
Functions | |
URL decoding | |
| char * | native_dynamic_url_decode (const char *encoded) |
| Decodes a percent-encoded URL string. | |
Query-string helpers | |
| char * | native_dynamic_query_value (const char *query, const char *key) |
| Extracts a parameter value from a query string. | |
Form-value helpers | |
| char * | native_dynamic_form_value (const char *body, const char *key) |
| Extracts a value from a URL-encoded form body. | |
Cookie helpers | |
| char * | native_dynamic_cookie_value (const char *cookie_header, const char *name) |
| Extracts a cookie value from a Cookie header string. | |
Request field extraction helpers for in-process dynamic handling.
Provides URL decoding, query-string parsing, and form-value extraction so that the dynamic runtime can read request parameters without delegating to a child process.
Definition in file native_dynamic_request_fields.h.
| char * native_dynamic_cookie_value | ( | const char * | cookie_header, |
| const char * | name ) |
Extracts a cookie value from a Cookie header string.
Searches cookie_header for name=value pairs separated by ; and returns the decoded value for the first match.
| cookie_header | Raw Cookie header value. |
| name | Cookie name to look up. |
Definition at line 148 of file native_dynamic_request_fields.c.
References extract_value_for_key().
Referenced by active_user_id_from_cookie_runtime(), csrf_token_from_cookie(), handle_request_cookie_value_command(), request_has_session_cookie(), and revoke_session_by_cookie_runtime().
| char * native_dynamic_form_value | ( | const char * | body, |
| const char * | key ) |
Extracts a value from a URL-encoded form body.
Searches body for key=value pairs separated by & and returns the decoded value for the first match.
| body | URL-encoded form body. |
| key | Form field name to look up. |
Definition at line 144 of file native_dynamic_request_fields.c.
References extract_value_for_key().
Referenced by csrf_request_token_dup_runtime(), handle_action_route(), handle_request_form_value_command(), and request_form_value_dup_runtime().
| char * native_dynamic_query_value | ( | const char * | query, |
| const char * | key ) |
Extracts a parameter value from a query string.
Searches query for key=value pairs separated by & and returns the decoded value for the first match.
| query | Raw query string (without the leading ? ). |
| key | Parameter name to look up. |
Definition at line 140 of file native_dynamic_request_fields.c.
References extract_value_for_key().
Referenced by handle_request_query_value_command(), login_page_params_json_dup_runtime(), register_page_params_json_dup_runtime(), and resolve_declared_page_params_json_runtime().
| char * native_dynamic_url_decode | ( | const char * | encoded | ) |
Decodes a percent-encoded URL string.
Allocates a new buffer containing the decoded result. The + character is decoded as a space.
| encoded | Percent-encoded input string. |
Definition at line 24 of file native_dynamic_request_fields.c.
References hex_digit_value(), and len.
Referenced by extract_value_for_key().