Pharos 0.7.23
Modern Web Framework & Web App Hosting Service.
Loading...
Searching...
No Matches
native_request_path.c File Reference

Normalizes request targets by stripping query strings and remapping them under an app mount path. More...

#include "native_request_path.h"
#include "native_support.h"
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Macros

#define native_request_path_strdup   strdup

Functions

char * native_request_path_without_query (const char *target)
 Removes the query string component from a request target.
char * native_request_target_for_mount (const char *mount_path, const char *target)
 Remaps a request target so it is relative to an app mount path.

Detailed Description

Normalizes request targets by stripping query strings and remapping them under an app mount path.

Definition in file native_request_path.c.

Macro Definition Documentation

◆ native_request_path_strdup

#define native_request_path_strdup   strdup

Definition at line 16 of file native_request_path.c.

Referenced by native_request_target_for_mount().

Function Documentation

◆ native_request_path_without_query()

char * native_request_path_without_query ( const char * target)

Removes the query string component from a request target.

Parameters
targetRaw request target.
Returns
Newly allocated path without the query string, or NULL on failure.

Definition at line 19 of file native_request_path.c.

References dup_range(), and len.

Referenced by serve_runtime_stack_native().

◆ native_request_target_for_mount()

char * native_request_target_for_mount ( const char * mount_path,
const char * target )

Remaps a request target so it is relative to an app mount path.

Parameters
mount_pathApp mount path configured for the runtime.
targetRaw request target.
Returns
Newly allocated remapped target, or NULL on failure.

Definition at line 26 of file native_request_path.c.

References native_request_path_strdup.

Referenced by handle_app_or_runtime_request().