Add direct access to remaining path for routing

master
teknomunk 1 year ago
parent 5601578a4b
commit 1a9bca6080

@ -743,6 +743,19 @@ const char* http_request_get_full_path( struct http_request* req )
{
return req->full_path;
}
const char* http_request_get_remaining_path( struct http_request* req )
{
return req->path;
}
void http_request_route_eat_path( struct http_request* req, int count )
{
int remaining = strlen(req->path);
if( count > remaining ) {
count = remaining;
}
req->path = &req->path[count];
}
void http_request_process( struct http_request* req, ucontext_t* fallback )
{

@ -53,6 +53,8 @@ char* http_request_route_get_dir_or_file( struct http_request* req );
const char* http_request_route_query_key( struct http_request* req );
const char* http_request_route_query_value( struct http_request* req );
const char* http_request_get_full_path( struct http_request* req );
const char* http_request_get_remaining_path( struct http_request* req );
void http_request_route_eat_path( struct http_request* req, int count );
// Run the request fiber
void http_request_process( struct http_request* req, ucontext_t* fallback );

Loading…
Cancel
Save