std1.0.0-beta-7 SafeC docs

std :: http::static_files

Function std::http_safe_join

#include <std/http/static_files.h> source · definition

int http_safe_join(
    const &char root,
    const &char url_path,
    int allow_dotfiles,
    &String out,
)

Joins a URL path under 'root' after percent-decoding it and removing empty and "." segments; 0 (and 'out' untouched) if it contains a ".." segment, a backslash, a NUL byte or (unless allow_dotfiles) a segment starting with '.'.