category
http_docroot_paths
Shared helpers for validating requests and sandboxing document-root relative paths.
Availability:
logtalk_load(http_core(loader))Author: Paulo Moura
Version: 1:0:0
Date: 2026-06-05
Compilation flags:
staticRemarks:
(none)
Inherited public predicates:
(none)
Public predicates
(no local declarations; see entity ancestors if any)
Protected predicates
validate_relative_path/1
Validates a document-root relative request path atom.
Compilation flags:
staticTemplate:
validate_relative_path(Path)Mode and number of proofs:
validate_relative_path(+atom) - one_or_errorExceptions:
Path is a variable:instantiation_errorPath is neither a variable nor an atom:type_error(atom,Path)Path is not a safe document-root relative path:domain_error(http_docroot_relative_path,Path)validate_request/1
Validates a normalized HTTP request term.
Compilation flags:
staticTemplate:
validate_request(Request)Mode and number of proofs:
validate_request(+compound) - one_or_errorExceptions:
Request is not a valid normalized HTTP request term:domain_error(http_request,Request)validate_document_root/1
Validates an absolute document root path atom.
Compilation flags:
staticTemplate:
validate_document_root(DocumentRoot)Mode and number of proofs:
validate_document_root(+atom) - one_or_errorExceptions:
DocumentRoot is a variable:instantiation_errorDocumentRoot is neither a variable nor an atom:type_error(atom,DocumentRoot)DocumentRoot is not a valid absolute document root path:domain_error(http_docroot_document_root,DocumentRoot)supported_method/1
True when the request method is supported for document-root serving, currently get or head.
Compilation flags:
staticTemplate:
supported_method(Request)Mode and number of proofs:
supported_method(+compound) - zero_or_oneresolved_target_path/3
Resolves a request path against a document root and succeeds only when the resulting path stays within that root.
Compilation flags:
staticTemplate:
resolved_target_path(Path,Root,Candidate)Mode and number of proofs:
resolved_target_path(+atom,+atom,-atom) - zero_or_onepath_within_root/2
True when the candidate path is the document root itself or a path nested under it.
Compilation flags:
staticTemplate:
path_within_root(Root,Candidate)Mode and number of proofs:
path_within_root(+atom,+atom) - zero_or_onePrivate predicates
(no local declarations; see entity ancestors if any)
Operators
(none)